Skip to content

Commit d45944b

Browse files
committed
Avoid using the deprecated save-state command
For full details, see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 47e6117 commit d45944b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

main.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
gitForWindowsUsrBinPath
1010
} from './src/git'
1111
import * as fs from 'fs'
12-
import * as coreCommand from '@actions/core/lib/command'
1312

1413
const flavor = core.getInput('flavor')
1514
const architecture = core.getInput('architecture')
@@ -252,16 +251,16 @@ function cleanup(): void {
252251
/**
253252
* Indicates whether the POST action is running
254253
*/
255-
export const isPost = !!process.env['STATE_isPost']
254+
export const isPost = !!core.getState('isPost')
256255

257256
if (!isPost) {
258257
run()
259258
/*
260259
* Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
261260
* This is necessary since we don't have a separate entry point.
262-
* Inspired by https://github.com/actions/checkout/blob/v3.0.2/src/state-helper.ts#L69-L71
261+
* Inspired by https://github.com/actions/checkout/blob/v3.1.0/src/state-helper.ts#L56-L60
263262
*/
264-
coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true')
263+
core.saveState('isPost', 'true')
265264
} else {
266265
// If the POST action is running, we cleanup our artifacts
267266
cleanup()

0 commit comments

Comments
 (0)