File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,14 @@ export namespace Action {
11
11
await Util . saveAppTokenToSecret ( secretName , token )
12
12
core . info ( `Token save in secret "${ secretName } "` )
13
13
}
14
+
14
15
core . setSecret ( token )
15
16
core . setOutput ( 'token' , token )
17
+
18
+ const variableName = core . getInput ( 'VARIABLE_NAME' )
19
+ if ( variableName ) {
20
+ core . exportVariable ( variableName , token )
21
+ }
16
22
} catch ( e ) {
17
23
core . error ( e )
18
24
core . setFailed ( e . message )
Original file line number Diff line number Diff line change
1
+ import { getInput } from '@actions/core'
1
2
import { State } from './state'
2
3
import { Action } from './action'
3
4
4
5
if ( ! State . isPost ) {
5
6
Action . run ( )
6
7
} else {
7
- Action . cleanup ( )
8
+ if ( getInput ( 'CLEAN_SECRET' ) === 'true' ) {
9
+ Action . cleanup ( )
10
+ }
8
11
}
Original file line number Diff line number Diff line change 1
- import * as coreCommand from '@actions/core/lib/command '
1
+ import { getState , saveState } from '@actions/core'
2
2
3
3
export namespace State {
4
- export const isPost = ! ! process . env [ 'STATE_isPost' ]
4
+ export const isPost = ! ! getState ( 'isPost' )
5
5
6
6
// Publish a variable so that when the POST action runs, it can determine
7
7
// it should run the cleanup logic. This is necessary since we don't have
8
8
// a separate entry point.
9
9
if ( ! isPost ) {
10
- coreCommand . issueCommand ( 'save-state' , { name : ' isPost' } , ' true' )
10
+ saveState ( ' isPost', true )
11
11
}
12
12
}
You can’t perform that action at this time.
0 commit comments