Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: replace deprecated command with environment file #6417

Merged
merged 1 commit into from Jul 13, 2023
Merged

github: replace deprecated command with environment file #6417

merged 1 commit into from Jul 13, 2023

Conversation

jongwooo
Copy link
Contributor

@jongwooo jongwooo commented Jun 27, 2023

Description

Resolve #6416

Update .github/workflows/release.yml 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 file 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=name::${PACKAGE_NAME}

TO-BE

echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT

RELEASE NOTES: none

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Jul 3, 2023
@@ -51,7 +51,7 @@ jobs:
run: |
PACKAGE_NAME=protoc-gen-go-grpc.${GITHUB_REF#refs/tags/cmd/protoc-gen-go-grpc/}.${{ matrix.goos }}.${{ matrix.goarch }}.tar.gz
tar -czvf $PACKAGE_NAME -C build .
echo ::set-output name=name::${PACKAGE_NAME}
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the blog post you linked to: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/, I see the following example

- name: Set output
run: echo "{name}={value}" >> $GITHUB_OUTPUT

So, should this be:

echo "{name}={PACKAGE_NAME}" >> $GITHUB_OUTPUT

Also, can you verify that your change works?

Copy link
Contributor Author

@jongwooo jongwooo Jul 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can you verify that your change works?

@easwars Thanks for the review! This issue was also present in grpc-kotlin and has been merged.
I found an example code in GitHub Docs, you can set the name and value as below:

- name: Set color
  id: random-color-generator
  run: echo "SELECTED_COLOR=green" >> "$GITHUB_OUTPUT"
- name: Get color
  run: echo "The selected color is ${{ steps.random-color-generator.outputs.SELECTED_COLOR }}"

@easwars easwars removed the stale label Jul 6, 2023
@easwars
Copy link
Contributor

easwars commented Jul 6, 2023

Removing the stale label since I had forgotten to publish my comment. Giving the author more time to respond to this.

@dfawley
Copy link
Member

dfawley commented Jul 11, 2023

So, it's worse than just this. I tested this change, and it works, but it turns out actions/upload-release-asset@v1 also uses set-output and is deprecated. They recommend using a third-party action instead: softprops/action-gh-release

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine as-is, but it seems there's more work to do if they get rid of set-output entirely

@dfawley dfawley assigned easwars and unassigned jongwooo Jul 13, 2023
@easwars easwars merged commit 9489082 into grpc:master Jul 13, 2023
11 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace deprecated set-output command with environment file
3 participants