Replace deprecated command with environment file by jongwooo · Pull Request #368 · nginx/nginx-prometheus-exporter (original) (raw)

Proposed changes

Resolve #367

Update workflows to use environment file instead of deprecated set-output command.
For more information, see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

I found the workflow files that use set-output command through the following command:

$ find . -name '.yml' -o -name '.yaml' | xargs egrep '\bset-output\b'

AS-IS

echo "::set-output name=go_path::$(go env GOPATH)"

run: echo "::set-output name=go_version::$(grep "go 1." go.mod | cut -d " " -f 2)")

TO-BE

echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT

run: echo "go_version=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_OUTPUT)

Checklist

Before creating a PR, run through this checklist and mark each as complete.