Skip to content

deprecated-commands

GitHub Actionscorrectnessno fixdefault: errorgithub-actions/actionlint

Reports a script that uses a workflow command that GitHub has disabled or deprecated: ::set-output, ::save-state, ::set-env or ::add-path.

GitHub disabled set-env and add-path because any tool that prints a line to the log could set an environment variable or change the PATH of the job, so those two no longer work. set-output and save-state have the same weakness, are deprecated and make the run show a warning.

To fix, append to the file the runner provides: echo "name=value" >> "$GITHUB_OUTPUT", and $GITHUB_STATE, $GITHUB_ENV or $GITHUB_PATH for the others.

Reported
jobs:
a:
steps:
- run: echo "::set-output name=v::1"
- run: |
echo "::save-state name=a::b"
echo ok
- run: echo "::notice::fine"
github-actions:
lint:
rules:
deprecated-commands: error # off, warn, error (default)

Enabled by the presets: github-actions/actionlint.

Suppress one line with sudsy-disable-next-line deprecated-commands in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
actionlint deprecated-commands full