-
Notifications
You must be signed in to change notification settings - Fork 594
Post comment on workflow run ready #224
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds automatic PR commenting functionality for workflow runs triggered via repository_dispatch events. When a workflow is dispatched, a comment will be posted to the associated pull request with a link to track the workflow run's progress.
Key Changes:
- Introduced a new
dispatch_comment.jsscript that posts comments to PRs when workflows are triggered via repository dispatch - Added
dispatch-notifyjobs to multiple workflow files to execute the commenting functionality - Removed the unused
trigger_on_label.jsscript
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/dispatch_comment.js | New script that posts workflow run links as PR comments |
| scripts/trigger_on_label.js | Removed unused label-based trigger logic |
| .github/workflows/tests-full.yml | Added dispatch-notify job and issues write permission |
| .github/workflows/examples-unsloth.yml | Added dispatch-notify job and issues write permission |
| .github/workflows/examples-spider.yml | Added dispatch-notify job and issues write permission |
| .github/workflows/examples-compat.yml | Added dispatch-notify job and issues write permission |
| .github/workflows/examples-calc-x.yml | Added dispatch-notify job and issues write permission |
| .github/workflows/examples-apo.yml | Added dispatch-notify job and issues write permission |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await github.rest.issues.createComment({ | ||
| owner, | ||
| repo, | ||
| issue_number: pullNumber, | ||
| body, | ||
| }); |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The createComment API call should include error handling. If the PR number is invalid or the API call fails, the workflow will crash without providing useful feedback. Consider wrapping this in a try-catch block and using core.setFailed() or core.warning() to handle failures gracefully.
No description provided.