File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { State } from './state'
1
2
import { Action } from './action'
2
3
3
- const isPost = ! ! process . env [ 'STATE_isPost' ]
4
-
5
- console . log ( JSON . stringify ( process . env , null , 2 ) )
6
-
7
- if ( ! isPost ) {
4
+ if ( ! State . isPost ( ) ) {
8
5
Action . run ( )
9
6
} else {
10
7
Action . cleanup ( )
Original file line number Diff line number Diff line change
1
+ import * as coreCommand from '@actions/core/lib/command'
2
+
3
+ export namespace State {
4
+ export const isPost = ( ) => ! ! process . env [ 'STATE_isPost' ]
5
+
6
+ // Publish a variable so that when the POST action runs, it can determine
7
+ // it should run the cleanup logic. This is necessary since we don't have
8
+ // a separate entry point.
9
+ if ( ! isPost ) {
10
+ coreCommand . issueCommand ( 'save-state' , { name : 'isPost' } , 'true' )
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments