ci: switch away from pull_request_target in the pre-commit workflow [RHIDP 11561]#306
Conversation
…ch away from the unsafe pull_request_target trigger
PR Reviewer Guide 🔍(Review updated until commit 983b410)Here are some key observations to aid the review process:
|
BranchesRemoved authorization job and manual approval safeguard, Simplified checkout to use default PR context instead of fork repository PR Type(Describe updated until commit 983b410)Enhancement Description
|
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
| ||||
| Documentation |
|
pull_request_target [RHIDP 11561]pull_request_target in the pre-commit workflow [RHIDP 11561]
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
/cherry-pick release-1.9
|
|
@rm3l: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: rhdh-qodo-merge[bot] <232573409+rhdh-qodo-merge[bot]@users.noreply.github.com>
166949a to
983b410
Compare
|
/cc @kim-tsao |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
|
/review |
|
Persistent review updated to latest commit 983b410 |
Co-authored-by: rhdh-qodo-merge[bot] <232573409+rhdh-qodo-merge[bot]@users.noreply.github.com>
|
/lgtm |
Revoked default permissions and updated checkout action settings.
|
New changes are detected. LGTM label has been removed. |
Refactor PR number retrieval to validate the number and handle invalid cases.
|
|
@rm3l: new pull request created: #308 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@rm3l: #306 failed to apply on top of branch "release-1.8": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@rm3l: #306 failed to apply on top of branch "release-1.7": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…ommit workflow [RHIDP 11561] (redhat-developer#306) Co-authored-by: rhdh-qodo-merge[bot] <232573409+rhdh-qodo-merge[bot]@users.noreply.github.com>
…ommit workflow [RHIDP 11561] (redhat-developer#306) Co-authored-by: rhdh-qodo-merge[bot] <232573409+rhdh-qodo-merge[bot]@users.noreply.github.com>



Description of the change
This splits the
pre-commitworkflow into 2 different workflows to switch away from the unsafepull_request_targettrigger.As a consequence, instead of automatically pushing the pre-commit diff to the PR branch, the user will just be made aware of the failures with clear instructions. It will then be up to the PR author or maintainers to run the pre-commit hooks and push the changes.
More context in https://issues.redhat.com/browse/RHIDP-11561
Which issue(s) does this PR fix or relate to
Fixes https://issues.redhat.com/browse/RHIDP-11561
How to test changes / Special notes to the reviewer
This takes inspiration from the upstream backstage/charts repo that we depend on: https://github.com/backstage/charts/blob/main/.github/workflows/pre-commit-comment.yaml
Example of comment in the PR:
rm3l#1 (comment)
Checklist
Chart.yamlaccording to Semantic Versioning.values.yamland added to the corresponding README.md. The pre-commit utility can be used to generate the necessary content. Usepre-commit run -ato apply changes. The pre-commit Workflow will do this automatically for you if needed.pre-commithook.ct lintcommand.