From 3fea4e0b704f4ec6a652bb4c28391efb5a0b7a8c Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Wed, 19 Oct 2022 15:44:21 +0300 Subject: [PATCH] Use core.saveState instead of raw 'save-state' command The 'save-state' and 'set-output' commands are deprecated since 2022-10-11 and cause warnings when used in workflows: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ The saveState function from @actions/core >= 1.10.0 uses the new way to pass data to the post actions ($GITHUB_STATE); use that function instead of sending the deprecated 'save-state' command directly. --- dist/main/index.js | 3 +-- src/main.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index c81b2a90..f0695ca0 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -4287,7 +4287,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IsPost = void 0; const core = __importStar(__nccwpck_require__(186)); -const coreCommand = __importStar(__nccwpck_require__(351)); const exec = __importStar(__nccwpck_require__(514)); const which_1 = __importDefault(__nccwpck_require__(207)); exports.IsPost = !!process.env['STATE_isPost']; @@ -4364,7 +4363,7 @@ function upload() { if (!exports.IsPost) { // 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. - coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true'); + core.saveState('isPost', 'true'); setup(); } else { diff --git a/src/main.ts b/src/main.ts index 3b547362..5e8cedba 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,4 @@ import * as core from '@actions/core'; -import * as coreCommand from '@actions/core/lib/command' import * as exec from '@actions/exec'; import which from 'which'; @@ -79,7 +78,7 @@ async function upload() { if (!IsPost) { // 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. - coreCommand.issueCommand('save-state', {name: 'isPost'}, 'true') + core.saveState('isPost', 'true'); setup() } else { // Post