Improve stateHelper
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>pull/87/head
parent
e53a3da260
commit
c3b8f61f90
@ -1,14 +1,12 @@
|
||||
// From https://github.com/actions/checkout/blob/master/src/state-helper.ts
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import * as coreCommand from '@actions/core/lib/command';
|
||||
|
||||
/**
|
||||
* Indicates whether the POST action is running
|
||||
*/
|
||||
export const IsPost = !!process.env['STATE_isPost'];
|
||||
export const builderName = !!process.env['STATE_builderName'];
|
||||
|
||||
export function setBuilderName(builderName: string) {
|
||||
core.saveState('builderName', builderName);
|
||||
}
|
||||
|
||||
// Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
|
||||
// This is necessary since we don't have a separate entry point.
|
||||
if (!IsPost) {
|
||||
coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true');
|
||||
core.saveState('isPost', 'true');
|
||||
}
|
||||
|
Loading…
Reference in New Issue