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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →