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

NH-62724: update secrets for github_action #83

Merged
merged 2 commits into from
Oct 13, 2023
Merged

NH-62724: update secrets for github_action #83

merged 2 commits into from
Oct 13, 2023

Conversation

xuan-cao-swi
Copy link
Contributor

@xuan-cao-swi xuan-cao-swi commented Oct 6, 2023

@xuan-cao-swi xuan-cao-swi marked this pull request as ready for review October 6, 2023 20:53
@xuan-cao-swi xuan-cao-swi requested a review from a team October 6, 2023 20:53
Copy link
Contributor

@cheempz cheempz left a comment

Choose a reason for hiding this comment

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

Looks good but I have a question about the token needed for "create release". And also this: how is the TRACE_BUILD_RUBY_ACTIONS_API_TOKEN used?

- name: Create release draft that includes the checksum
uses: actions/github-script@v3
with:
github-token: ${{secrets.CI_GITHUB_TOKEN}}
github-token: ${{ steps.github-token.outputs.token }}
Copy link
Contributor

@cheempz cheempz Oct 6, 2023

Choose a reason for hiding this comment

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

Curious, this was changed from the automatic GITHUB_TOKEN... does it not work for create release (even if given higher privilege) and we really need an Admin-level token like secrets.APPLICATION_PRIVATE_KEY?

Copy link
Contributor

Choose a reason for hiding this comment

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

updated wrong link in above comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TRACE_BUILD_RUBY_ACTIONS_API_TOKEN (e.g. TRACE_BUILD_TOKEN in the action file) is used in https://github.com/solarwindscloud/swotel-ruby/blob/main/Rakefile#L96-L99. This is a legacy method that verify the oboe file is consistent with the aws bucket downloaded.

For the create release, probably only need the contents: write permission (ref)

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Let's leave the TRACE_BUILD_RUBY_ACTIONS_API_TOKEN as-is then, that Rake task might be useful.

For creating the release, can you update line 84 to use the automatic GITHUB_TOKEN instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can then remove the Obtain github token step.

@xuan-cao-swi xuan-cao-swi requested a review from cheempz October 11, 2023 15:53
Copy link
Contributor

@cheempz cheempz left a comment

Choose a reason for hiding this comment

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

Thanks @xuan-cao-swi, one change please.

- name: Create release draft that includes the checksum
uses: actions/github-script@v3
with:
github-token: ${{secrets.CI_GITHUB_TOKEN}}
github-token: ${{ steps.github-token.outputs.token }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Let's leave the TRACE_BUILD_RUBY_ACTIONS_API_TOKEN as-is then, that Rake task might be useful.

For creating the release, can you update line 84 to use the automatic GITHUB_TOKEN instead?

@xuan-cao-swi
Copy link
Contributor Author

@cheempz Thanks, I have changed to default GITHUB_TOKEN

@xuan-cao-swi xuan-cao-swi requested a review from cheempz October 12, 2023 14:15
Copy link
Contributor

@cheempz cheempz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the revisit @xuan-cao-swi!

@xuan-cao-swi xuan-cao-swi merged commit d7ff935 into main Oct 13, 2023
12 checks passed
@cheempz cheempz deleted the NH-62724 branch October 13, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants