auto_pr_comments_from_forks icon indicating copy to clipboard operation
auto_pr_comments_from_forks copied to clipboard

GitHub Feature Update

Open HarishTeens opened this issue 5 years ago • 5 comments

Hey, I think you might wanna check out on this, https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks

After this update, changing the trigger would solve the problem natively through actions, instead of using a cron job.

HarishTeens avatar Sep 16 '20 05:09 HarishTeens

@HarishTeens yep, GitHub actually contacted me about this repo and I had to explain why it was needed for the FOSS projects :) I'm very happy they listened and came up with the workflow_run event :)

nyurik avatar Sep 16 '20 06:09 nyurik

I'm having some trouble with workflow_run and hoping to chat with some other users about it. This issue is as close as I can find to a workflow_run users group!

To be able to make a comment on the correct PR, I need to know which PR triggered the workflow_run. Conveniently, the event contains a reference to the pull request at event.workflow_run.pull_requests[0]: https://github.com/nyurik/auto_pr_comments_from_forks/runs/884553986?check_suite_focus=true#step:2:231

Unfortunately on fork PRs, event.workflow_run.pull_requests is always empty []. 🤦‍♂️

Have you figured out how to utilize workflow_run to comment on fork PRs?

kd7lxl avatar Oct 02 '20 19:10 kd7lxl

@kd7lxl i haven't tried to adapt the new events just yet, hopefully will do so in the near term.

nyurik avatar Oct 02 '20 20:10 nyurik

With two simple changes, #4 and #5, I got this working for my use case. 👍

kd7lxl avatar Oct 02 '20 22:10 kd7lxl

I have a greatly simplified solution to all this (incl. finding the pull request from within workflow_run). It's all in this 1 file:

https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml

oprypin avatar Feb 08 '21 00:02 oprypin