Skip to content
Latchkey

GitHub Actions "The save-state and set-output commands are deprecated"

GitHub deprecated the stdout workflow commands ::save-state:: and ::set-output:: for security reasons and is disabling them. Code that still echoes them must write to the $GITHUB_STATE and $GITHUB_OUTPUT files instead.

What this error means

Runs emit deprecation warnings (or fail once disabled) referencing save-state and set-output commands.

github-actions
Warning: The `save-state` command is deprecated and will be disabled soon.
Please upgrade to using Environment Files.
Warning: The `set-output` command is deprecated and will be disabled soon.

Common causes

Action or step echoes the legacy command

A run step or an old action version still prints ::set-output name=x:: or ::save-state:: to stdout.

Outdated action versions

Older releases of common actions used the deprecated commands; they are fixed in newer tags.

How to fix it

Write to the environment files

  1. Replace echo "::set-output name=key::value" with appending to $GITHUB_OUTPUT.
  2. Replace ::save-state:: with appending to $GITHUB_STATE.
.github/workflows/ci.yml
- id: vars
  run: |
    echo "key=value" >> "${GITHUB_OUTPUT}"
- run: echo "${{ steps.vars.outputs.key }}"

Upgrade actions to current tags

  1. Bump pinned action versions to releases that use environment files.
  2. Re-run and confirm the warnings clear.

How to prevent it

  • Grep workflows and composite actions for set-output and save-state during reviews.
  • Keep actions pinned to maintained major versions.

Related guides

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