-
Notifications
You must be signed in to change notification settings - Fork 13
fix: support workflow_run events for github status and pr comments #37
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
adds proper detection of workflow_run events to ensure commit statuses and pr comments are posted to the correct sha when the action is triggered from a workflow_run context (e.g., secure fork pr workflows) - detect workflow_run event and use workflow_run.head_sha for status - find pr number from workflow_run context for comments - update both status and comment sha references
|
Confirmed it works:
|
ensures commit statuses are posted to the correct sha when the action is triggered from a workflow_run context (e.g., secure fork pr workflows) applies the same fix as ipshipyard/ipfs-deploy-action#37
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 support for workflow_run events to ensure GitHub commit statuses and PR comments are posted to the correct SHA when the action is triggered from a workflow_run context, particularly for secure fork PR workflows.
- Enhanced SHA detection logic to handle
workflow_runevents by usingworkflow_run.head_sha - Added PR number discovery for
workflow_runevents by querying the GitHub API - Updated comment creation/update conditions to support
workflow_runevents
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| action.yml | Enhanced event handling for workflow_run events, added PR discovery logic, and updated comment conditions |
| CHANGELOG.md | Added changelog entry documenting the new workflow_run event support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- match PRs by SHA instead of taking the first one - add warning when multiple PRs exist but none match SHA - add warning when no PRs are found for the branch
2color
left a comment
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.
Overall looks good to me. See my suggestions
Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
|
Tested with your suggestions in ipfs/specs and works as expected (ipfs/specs#331 (comment)), I'm going forward with release. |
* fix: support workflow_run events for github status ensures commit statuses are posted to the correct sha when the action is triggered from a workflow_run context (e.g., secure fork pr workflows) applies the same fix as ipshipyard/ipfs-deploy-action#37 * docs: add dual workflow pattern for fork PRs * Update README.md Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com> * docs: align with ipfs-deploy-action best practices - update dual workflows section title for clarity - prepare for v1.0.0 release --------- Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
adds proper detection of
workflow_runevents to ensure commit statuses and pr comments are posted to the correctshawhen the action is triggered from aworkflow_runcontext (e.g., secure fork pr workflows)workflow_runevent and useworkflow_run.head_shafor statusworkflow_runcontext for commentsshareferencesTODO