fix: support workflow_run events for github status and pr comments#37
Merged
fix: support workflow_run events for github status and pr comments#37
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
Contributor
Author
|
Confirmed it works:
|
lidel
added a commit
to ipshipyard/dnslink-action
that referenced
this pull request
Aug 24, 2025
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.
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
reviewed
Aug 25, 2025
2color
reviewed
Aug 25, 2025
2color
reviewed
Aug 25, 2025
2color
reviewed
Aug 25, 2025
2color
reviewed
Aug 25, 2025
Contributor
2color
left a comment
There was a problem hiding this comment.
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>
Contributor
Author
|
Tested with your suggestions in ipfs/specs and works as expected (ipfs/specs#331 (comment)), I'm going forward with release. |
lidel
added a commit
to ipshipyard/dnslink-action
that referenced
this pull request
Aug 25, 2025
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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