Skip to content

chore: Migrate from the pull_request_target trigger - #128

Open
Benjamin-Philip wants to merge 8 commits into
apache:mainfrom
Benjamin-Philip:migrate-from-pull-request-trigger
Open

Benjamin-Philip wants to merge 8 commits into
apache:mainfrom
Benjamin-Philip:migrate-from-pull-request-trigger

Conversation

@Benjamin-Philip

Copy link
Copy Markdown
Collaborator

What issue does this PR close?

Closes #126.

What's Changed

This PR migrates the PR Comment workflow from the pull_request_target trigger to the workflow_run trigger. Commenting the Preview URL is now a 2 step process. First, the preview comment is generated and uploaded in the Docs workflow in the context of the fork repo. Then, the completed Docs workflow triggers the PR Comment workflow, which downloads and makes the preview comment in the context of the base repo.

Tested in this dummy PR via manual workflow_dispatch: Benjamin-Philip#1

Copilot AI balanced review requested due to automatic review settings November 10, 2026 07:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown

Preview URL: https://Benjamin-Philip.github.io/arrow-erlang-1

If the preview URL doesn't work, you may have forgotten to configure your fork repository for preview.
See https://github.com/apache/arrow-erlang/blob/main/CONTRIBUTING.md#forks for instructions on how to configure.

@kou

kou commented Nov 11, 2026

Copy link
Copy Markdown
Member

Tested in this dummy PR via manual workflow_dispatch: Benjamin-Philip#1

It's a test that opens a PR from the same repository not a fork repository. This change will not work with a PR from a fork repository...

@Benjamin-Philip

Copy link
Copy Markdown
Collaborator Author

It's a test that opens a PR from the same repository not a fork repository. This change will not work with a PR from a fork repository...

The changes I've made are based on the example in the GitHub Actions docs and a similar workflow in the Erlang/OTP repo.

The repository difference becomes an issue if I used the pull_request trigger, which would have run in the context of the fork repository. However, workflow_run trigger runs in a privileged context like pull_request_target.

If you still want to test, I could make a PR against your fork.

@kou

kou commented Nov 12, 2026

Copy link
Copy Markdown
Member

I've pushed this branch to my fork's main with an adaption kou@301c843 : https://github.com/kou/arrow-erlang/
Could you test it?

@Benjamin-Philip

Copy link
Copy Markdown
Collaborator Author

I've created a PR here: kou#1. Looks like you'll need to approve running the workflows first.

This branch has not been deployed

No deployments
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.

Migrate from pull_request_target

3 participants