From 36d00ed419023f6b8320f3ed695686938e23ce5f Mon Sep 17 00:00:00 2001 From: yuriyryabikov <22548029+kurok@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:07:45 +0100 Subject: [PATCH] fix: write outputs to GITHUB_OUTPUT file instead of ::set-output The bundled @actions/core v1.2.6 still emits the deprecated '::set-output name=X::Y' workflow command, which GitHub has warned about since 2022-10 and has announced will be disabled outright: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. Two viable fixes: - Bump @actions/core to >= 1.10.0 (the version that switched to GITHUB_OUTPUT internally). Tried; transitive deps pull modern JS (private class fields) that @vercel/ncc 0.25.1 can't parse, which would force a separate ncc major bump with much larger dist churn. - Bypass core.setOutput entirely and write directly to the GITHUB_OUTPUT file. Modern runners always set that env var. Going with the second option. 11-line change in src/index.js with an equivalent 11-line diff in the rebuilt dist/index.js. No dependency updates; ncc rebuild is reproducible. Fallback path through core.setOutput() retained for the unlikely case that GITHUB_OUTPUT isn't set (pre-2022 self-hosted runner or local dry-run). Output values (label, ec2InstanceId) never contain newlines, so the plain 'key=value\n' format is safe. Signed-off-by: yuriyryabikov <22548029+kurok@users.noreply.github.com> --- dist/index.js | 11 +++++++++++ src/index.js | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/dist/index.js b/dist/index.js index 05179d1d..db82521f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -55441,12 +55441,23 @@ module.exports = { /***/ 4351: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +const fs = __webpack_require__(35747); +const os = __webpack_require__(12087); const aws = __webpack_require__(61150); const gh = __webpack_require__(56989); const config = __webpack_require__(34570); const core = __webpack_require__(42186); +// Write directly to the $GITHUB_OUTPUT file. The bundled @actions/core +// v1.2.6 still emits the deprecated '::set-output name=X::Y' workflow +// command; GitHub runners now surface that as a warning. Bypass the +// legacy path — modern runners always set GITHUB_OUTPUT. function setOutput(label, ec2InstanceId) { + const outputFile = process.env.GITHUB_OUTPUT; + if (outputFile) { + fs.appendFileSync(outputFile, `label=${label}${os.EOL}ec2-instance-id=${ec2InstanceId}${os.EOL}`); + return; + } core.setOutput('label', label); core.setOutput('ec2-instance-id', ec2InstanceId); } diff --git a/src/index.js b/src/index.js index 00bc5152..30708a5b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,20 @@ +const fs = require('fs'); +const os = require('os'); const aws = require('./aws'); const gh = require('./gh'); const config = require('./config'); const core = require('@actions/core'); +// Write directly to the $GITHUB_OUTPUT file. The bundled @actions/core +// v1.2.6 still emits the deprecated '::set-output name=X::Y' workflow +// command; GitHub runners now surface that as a warning. Bypass the +// legacy path — modern runners always set GITHUB_OUTPUT. function setOutput(label, ec2InstanceId) { + const outputFile = process.env.GITHUB_OUTPUT; + if (outputFile) { + fs.appendFileSync(outputFile, `label=${label}${os.EOL}ec2-instance-id=${ec2InstanceId}${os.EOL}`); + return; + } core.setOutput('label', label); core.setOutput('ec2-instance-id', ec2InstanceId); }