deprecated-commands
What it does
Section titled “What it does”Reports a script that uses a workflow command that GitHub has disabled or deprecated: ::set-output, ::save-state, ::set-env or ::add-path.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”jobs: a: steps: - run: echo "::set-output name=v::1" - run: | echo "::save-state name=a::b" echo ok - run: echo "::notice::fine"Configuration
Section titled “Configuration”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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| actionlint | deprecated-commands |
full |