fix(ci): Make sure to checkout the PR branch before pushing the diff generated from the pre-commit hooks#230
Conversation
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/pre-commit.yaml:24` </location>
<code_context>
environment:
${{ (github.event.pull_request.head.repo.full_name == github.repository ||
- contains(fromJSON('["coreydaley","gazarenkov","kadel","nickboldt","rm3l","kim-tsao","Fortune-Ndlovu","subhashkhileri","zdrapela","openshift-cherrypick-robot", "Fortune-Ndlovu", "subhashkhileri", "zdrapela"]'), github.event.pull_request.user.login)) && 'internal' || 'external' }}
+ contains(fromJSON('["gazarenkov","kadel","nickboldt","rm3l","kim-tsao","Fortune-Ndlovu","subhashkhileri","zdrapela","openshift-cherrypick-robot", "Fortune-Ndlovu", "subhashkhileri", "zdrapela"]'), github.event.pull_request.user.login)) && 'internal' || 'external' }}
runs-on: ubuntu-latest
steps:
</code_context>
<issue_to_address>
Duplicate entries in the approvers list may be unnecessary.
Consider removing the duplicate names to improve maintainability and readability.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…generated from the pre-commit hooks Context: https://github.com/redhat-developer/rhdh-operator/actions/runs/17475391158/job/49670949036?pr=1584
0ce599e to
285697b
Compare
|
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/pre-commit.yaml:79` </location>
<code_context>
- git fetch --prune
- git pull --rebase --autostash
+
git add -A .
git commit \
-m "chore(pre-commit): Auto-fix hooks" \
-m "Co-authored-by: $GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>"
</code_context>
<issue_to_address>
Using 'git add -A .' may stage unintended changes outside manifests.
Restrict the 'git add' path to only include manifest files to avoid staging unrelated changes.
Suggested implementation:
```
git add **/manifest*.yml **/manifests/*.yml **/manifests/*.yaml
```
- Adjust the glob pattern(s) in the `git add` command to match the actual location and naming of your manifest files. For example, if your manifests are in a specific directory or have a different naming convention, update the pattern accordingly.
- If you have multiple types of manifest files (e.g., `.json`, `.yaml`, `.yml`), add those extensions as needed.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
/cherry-pick releae-1.6 |
|
@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. |
|
@rm3l: cannot checkout 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: new pull request created: #232 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. |
|
/cherry-pick release-1.6 |
|
@rm3l: #230 failed to apply on top of branch "release-1.6": 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. |
|
Cherry-picking to release-1.6 not needed. This workflow is not present in this branch. |

Description of the change
Applying the same fix done in redhat-developer/rhdh-operator#1599
Context:
This only affects workflows that have steps that auto-commit/push certain changes to the PR branch.
Which issue(s) does this PR fix or relate to
https://github.com/redhat-developer/rhdh-chart/actions/runs/17545997169/job/49827512012?pr=231
How to test changes / Special notes to the reviewer
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.Summary by Sourcery
Update the pre-commit GitHub Actions workflow to checkout the PR head branch before committing and pushing auto-fix changes, and refresh the internal approvers list.
CI:
Summary by Sourcery
Fix pre-commit GitHub workflow to correctly check out and push auto-generated fixes back to the pull request branch.
Bug Fixes:
Enhancements: