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
- Replace echo "::set-output name=key::value" with appending to $GITHUB_OUTPUT.
- 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
- Bump pinned action versions to releases that use environment files.
- 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
GitHub Actions "set-output command is deprecated" - Use GITHUB_OUTPUTFix GitHub Actions "The set-output command is deprecated" - migrate from ::set-output and ::save-state to the…
GitHub Actions "save-state command is deprecated" - Use GITHUB_STATEFix GitHub Actions "The save-state command is deprecated" - migrate ::save-state to the GITHUB_STATE environm…
GitHub Actions multiline output to GITHUB_OUTPUT without a delimiterFix the GitHub Actions error where a multiline step output written to GITHUB_OUTPUT with NAME=value syntax fa…