Skip to content
Latchkey

GitHub Actions "set-output command is deprecated" - Use GITHUB_OUTPUT

GitHub removed the legacy ::set-output and ::save-state workflow commands. Scripts that still echo them now warn (and eventually fail), and downstream steps read empty outputs.

What this error means

A run shows a warning that the set-output command is deprecated, and steps that consume the output get an empty value because the new file-based mechanism was not used.

Actions log
Warning: The `set-output` command is deprecated and will be disabled soon.
Please upgrade to using Environment Files.

Common causes

Legacy workflow command in a script

A run step still emits echo "::set-output name=x::value" or ::save-state, which GitHub has deprecated in favor of environment files.

An old third-party action

A pinned action version still uses the old command internally. Until it is updated, its outputs may be empty on current runners.

How to fix it

Write to GITHUB_OUTPUT instead

Append name=value pairs to the GITHUB_OUTPUT file and read them via steps.<id>.outputs.<name>.

.github/workflows/ci.yml
- id: vers
  run: echo "version=1.2.3" >> "$GITHUB_OUTPUT"
- run: echo "Got ${{ steps.vers.outputs.version }}"

Update or replace stale actions

  1. Bump third-party actions to a version that uses environment files.
  2. Replace ::save-state with appends to the GITHUB_STATE file.
  3. Search your scripts for ::set-output and migrate each occurrence.

How to prevent it

  • Use GITHUB_OUTPUT and GITHUB_STATE in all custom scripts.
  • Keep actions updated with Dependabot so deprecated commands are removed.
  • Grep workflows for ::set-output in CI to catch regressions.

Frequently asked questions

What causes ""set-output deprecated""?
A run step still emits echo "::set-output name=x::value" or ::save-state, which GitHub has deprecated in favor of environment files.
How do I fix "set-output deprecated"?
Append name=value pairs to the GITHUB_OUTPUT file and read them via steps.<id>.outputs.<name>.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card