Skip to content

chore(ci): replace deprecated set-output with GITHUB_OUTPUT#404

Open
mahmoodhamdi wants to merge 1 commit intoexpressjs:masterfrom
mahmoodhamdi:chore/fix-deprecated-set-output-ci
Open

chore(ci): replace deprecated set-output with GITHUB_OUTPUT#404
mahmoodhamdi wants to merge 1 commit intoexpressjs:masterfrom
mahmoodhamdi:chore/fix-deprecated-set-output-ci

Conversation

@mahmoodhamdi
Copy link
Copy Markdown

What

Replace the deprecated ::set-output workflow command with the $GITHUB_OUTPUT environment file in the CI workflow.

Why

GitHub deprecated the ::set-output command in October 2022. Every CI run currently produces a deprecation warning:

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

The list_env step uses set-output to expose installed package versions (eslint, nyc) so that later steps can conditionally run linting and coverage collection. This PR switches to the recommended $GITHUB_OUTPUT file approach, which is functionally equivalent but eliminates the deprecation warning.

Before:

awk ... '{ print "::set-output name=" $2 "::" $3 }'

After:

awk ... '{ print $2 "=" $3 }' >> "$GITHUB_OUTPUT"

Testing

The output format changes from ::set-output name=eslint::7.30.0 to eslint=7.30.0 written to $GITHUB_OUTPUT. Both approaches set steps.list_env.outputs.eslint and steps.list_env.outputs.nyc identically. The conditional steps (Lint code, Collect code coverage) continue to work as before.

GitHub deprecated the ::set-output workflow command in October 2022
and it now produces warnings on every CI run. Replace it with the
recommended $GITHUB_OUTPUT file approach.

Ref: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant