Skip to content

Conversation

@lidel
Copy link
Contributor

@lidel lidel commented Aug 23, 2025

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

TODO

  • merge and release new v1.x.x
  • update docs.ipfs.tech to use v1 tag
  • update specs.ipfs.tech to use v1 tag

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
@lidel
Copy link
Contributor Author

lidel commented Aug 23, 2025

@lidel lidel requested a review from 2color August 23, 2025 21:59
@lidel lidel marked this pull request as ready for review August 23, 2025 21:59
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
@2color 2color requested a review from Copilot August 24, 2025 13:07
Copy link

Copilot AI left a 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_run events by using workflow_run.head_sha
  • Added PR number discovery for workflow_run events by querying the GitHub API
  • Updated comment creation/update conditions to support workflow_run events

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.

lidel added 2 commits August 24, 2025 23:39
- 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
Copy link
Contributor

@2color 2color left a 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

lidel and others added 4 commits August 25, 2025 17:39
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>
@lidel
Copy link
Contributor Author

lidel commented Aug 25, 2025

Tested with your suggestions in ipfs/specs and works as expected (ipfs/specs#331 (comment)), I'm going forward with release.

@lidel lidel merged commit 6fdd7c1 into main Aug 25, 2025
1 check passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants