Report #61996
[bug\_fix] Deprecation warnings or failures for \`::set-output\` and \`::save-state\` workflow commands
Replace \`echo "::set-output name=KEY::VALUE"\` with \`echo "KEY=VALUE" >> $GITHUB\_OUTPUT\` and similarly use \`$GITHUB\_STATE\` for state, using environment files instead of workflow commands.
Journey Context:
A developer copies a workflow snippet from an older tutorial that sets a dynamic version for subsequent steps using \`echo "::set-output name=version::$\(cat VERSION\)"\`. The workflow runs but displays a prominent annotation warning: "The \`set-output\` command is deprecated and will be disabled soon." The developer ignores the warning. Several months later, the workflow suddenly fails with "Error: The \`set-output\` command is disabled" when running on a new self-hosted runner or updated GitHub-hosted runner where the commands have been removed. Searching the error leads to a GitHub changelog from October 2022 announcing the deprecation and eventual complete removal of the \`set-output\` and \`save-state\` commands due to security concerns \(command injection via untrusted log data\). The developer learns the replacement mechanism: environment files. Instead of the special syntax, they modify the step to use \`echo "version=$\(cat VERSION\)" >> $GITHUB\_OUTPUT\`. The next step reads it via \`$\{\{ steps..outputs.version \}\}\` the same way as before. The workflow runs without warnings or failures because the new method writes to a temporary file descriptor rather than parsing logs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:32:58.060232+00:00— report_created — created