-
-
Notifications
You must be signed in to change notification settings - Fork 313
Add pre-commit failure output to PR comments #4854
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
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: DonnieBLT <[email protected]>
|
@copilot try again |
Co-authored-by: DonnieBLT <[email protected]>
Done! I've modified the CI/CD workflow to capture and display the pre-commit failure output in PR comments. The comment will now include a collapsible "Pre-commit output" section showing the actual errors and warnings from the pre-commit run. Changes made in commit
When pre-commit checks fail on a PR, developers will now see the actual output showing which hooks failed and what issues were found, making it much easier to fix the problems without having to dig through the workflow logs. |
|
@copilot make it show just the last 100 lines since it might be a lot of text |
❌ Pre-commit checks failedThe pre-commit hooks found issues that need to be fixed. Please run the following commands locally to fix them: # Install pre-commit if you haven't already
pip install pre-commit
# Run pre-commit on all files
pre-commit run --all-files
# Or run pre-commit on staged files only
pre-commit runAfter running these commands, the pre-commit hooks will automatically fix most issues. 💡 Tip: You can set up pre-commit to run automatically on every commit by running: pre-commit installPre-commit outputFor more information, see the pre-commit documentation. |
Co-authored-by: DonnieBLT <[email protected]>
Updated in commit |
❌ Pre-commit checks failedThe pre-commit hooks found issues that need to be fixed. Please run the following commands locally to fix them: # Install pre-commit if you haven't already
pip install pre-commit
# Run pre-commit on all files
pre-commit run --all-files
# Or run pre-commit on staged files only
pre-commit runAfter running these commands, the pre-commit hooks will automatically fix most issues. 💡 Tip: You can set up pre-commit to run automatically on every commit by running: pre-commit installPre-commit output (last 100 lines)For more information, see the pre-commit documentation. |
Modified the CI/CD workflow to capture and display the actual pre-commit failure output in PR comments when pre-commit checks fail.
Changes Made
.github/workflows/ci-cd.yml: Changed from using thepre-commit/[email protected]action to running pre-commit manually to capture outputBenefits
This change helps developers quickly identify what specific pre-commit checks failed and what issues were found without having to dig through workflow logs. The output is displayed in a user-friendly collapsible section to keep comments clean while providing detailed diagnostic information. The 100-line limit ensures comments remain manageable even with lengthy pre-commit failures.
Testing
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.