From e02ebb3d92b2e6e211de0d3945bcb063f6f24d24 Mon Sep 17 00:00:00 2001 From: Josu Vergara Lecue Date: Wed, 26 Oct 2022 21:17:29 +0200 Subject: [PATCH] Issue 190: Use GITHUB_OUTPUT environment file to set output. This follows the guidelines described in https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2b8a7c6..fa53384 100644 --- a/index.js +++ b/index.js @@ -202,7 +202,8 @@ const pkg = getPackageJson(); console.log('newVersion 2:', newVersion); newVersion = `${tagPrefix}${newVersion}`; console.log(`newVersion after merging tagPrefix+newVersion: ${newVersion}`); - console.log(`::set-output name=newTag::${newVersion}`); + // Using sh as command instead of directly echo to be able to use file redirection + await runInWorkspace('sh', ['-c', `echo "newTag=${newVersion}" >> $GITHUB_OUTPUT`]); try { // to support "actions/checkout@v1" if (process.env['INPUT_SKIP-COMMIT'] !== 'true') { @@ -210,7 +211,7 @@ const pkg = getPackageJson(); } } catch (e) { console.warn( - 'git commit failed because you are using "actions/checkout@v2"; ' + + 'git commit failed because you are using "actions/checkout@v2" or later; ' + 'but that doesnt matter because you dont need that git commit, thats only for "actions/checkout@v1"', ); }