-
Notifications
You must be signed in to change notification settings - Fork 17
ci: CPLYTM-821 - run release-please with an installation token #577
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
ci: CPLYTM-821 - run release-please with an installation token #577
Conversation
b4a0c70 to
930a319
Compare
|
I need to better check how to address the kics alert. Moving to draft until I can continue working on it. |
930a319 to
8492720
Compare
jpower432
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one comment for possible simplification.
huiwangredhat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcusburghardt Great! After the review, I learned how to easily obtain a GitHub app token and also how to skip the bash script in favor of a python script.
release-please creates a PR bumping versions and drafting a changelog. By default the PR is owned by github-actions and therefore CI tests from other workflows are not executed to prevent loop. This commit makes release-please to use a GH App token. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Replaced the python code by actions/create-github-app-token to achieve the same outcome in a much simpler way. This action already ensures the token is masked and expiration is tied to the job. Explicit permissions are redundant, but it is intentional to make them explicit. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
e95e6c5 to
0e71174
Compare
|
Rebased |
Nice @huiwangredhat , thanks to @jpower432 I also learned about the create-github-app-token and implemented in the last commit. Things got much simpler. :) |
huiwangredhat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
jpower432
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @marcusburghardt! Just left one comment regarding the permission of the default token.
jpower432
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The failing e2e job seems unrelated.
1fd2b6b to
98bea2e
Compare
These permissions were defined for GITHUB_TOKEN and are no longer necessary since release-please is now using an installation token. Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
98bea2e to
b2df986
Compare
|
For transparency, there are two force-pushes after the reviews. I first tried something to isolate the issue with CI tests then I reverted it to the state it was approved. |
Summary
release-pleasecreates a PR bumping versions and drafting a changelog.By default the PR is owned by github-actions and therefore CI tests from other workflows are not executed to prevent loop. This PR makes release-please to use a GH App token.
Related Issues
CI tests are not executed when a PR is owned by
github-actions[bot]This repository has required tests triggered by other workflows. Since these tests are not executed, the PR cannot be merged, ultimately impacting the release process.
Review Hints
Here is the relevant documentation about "Triggering a workflow from a workflow":
It is also mentioned in the release-please documentation:
This simpler option would be to create a PAT but this does not scale well, so a Github App using a limited INSTALLATION TOKEN should work better.
The workflow was created based on official documentation and inspired by the work from @huiwangredhat in complytime/cac-content#26