ci: auto-commit pre-commit fixes on same-repo PRs - #484
Conversation
Similar to redhat-developer/rhdh-operator#3228, auto-commit and push pre-commit hook changes for same-repo PRs using the rhdh-bot token. Fork PRs retain the existing fail-and-comment behavior.
Code Review by Qodo
Context used✅ Cross-repo context Not relevant to this PR:
redhat-developer/rhdh Not relevant to this PR:
redhat-developer/rhdh-plugins Not relevant to this PR:
redhat-developer/rhdh-must-gather 1. Token stored in git
|
PR Summary by QodoCI: auto-commit pre-commit fixes on same-repo PRs
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Add id to pre-commit step and fail the workflow when pre-commit reports failure without leaving auto-fixable changes. Re-run pre-commit after auto-push to verify the tree is actually clean.
- Drop unnecessary job-level contents:write override; the push authenticates via RHDH_BOT_TOKEN, not GITHUB_TOKEN. - Use git status --porcelain instead of git diff --quiet to also detect untracked files generated by pre-commit hooks.
|
|
/agentic_review |
|
/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. |
|
Code review by qodo was updated up to the latest commit 603f64b |



Description of the change
Similar to redhat-developer/rhdh-operator#3228 for the Operator, this auto-commits and pushes pre-commit hook changes for same-repo PRs using the
rhdh-bottoken, reducing friction for maintainers, especially when reviewing PRs from Renovate in the same repo.For fork PRs, the existing behavior is preserved: the workflow fails and a comment is posted.
Which issue(s) does this PR fix or relate to
How to test changes / Special notes to the reviewer
rhdh-botauto-commits and pushes the fixes; workflow passes.pre-commit-comment.yamlworkflow posts a comment.RHDH_BOT_TOKENor push failure: workflow fails gracefully with the existing error message.Checklist
Chart.yamlaccording to Semantic Versioning. N/A — CI-only change.values.yamland added to the corresponding README.md. N/A — CI-only change.pre-commithook. N/A — CI-only change.ct lintcommand. N/A — CI-only change.