ci: Comment on PRs with the diff from the pre-commit hooks #292
+248
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
This PR enhances the pre-commit CI Workflow to automatically provide actionable feedback through PR comments in case the pre-commit hooks fail.
I initially planned to make the Workflow automatically push the pre-commit hooks diff, but ran into permission issues for PRs coming from forks.
The two-workflow approach is the recommended GitHub Actions pattern for safely commenting on PRs from forks, as it ensures untrusted code never runs with write permissions while still providing helpful feedback to contributors.
The workflow will:
To keep things clean, the existing lint Workflow (which used to run pre-commit) and the test workflow (used to run
ct lintas well asct install) have been reorganized:ct lintct installpre-commitand automatically trigger thepre-commit CommentworkflowExisting or Associated Issue(s)
Closes #288
Additional information
Example of comment and how it affects the PR: rm3l#1 (comment)
Checklist
Chart.yamlaccording to semver. (N/A - workflow changes only)values.yamland added to the README.md. (N/A - workflow changes only)ct lintcommand. (N/A - workflow changes only)