Skip to content
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

GitHub Feature Update #3

Open
HarishTeens opened this issue Sep 16, 2020 · 5 comments
Open

GitHub Feature Update #3

HarishTeens opened this issue Sep 16, 2020 · 5 comments

Comments

@HarishTeens
Copy link

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.

@nyurik
Copy link
Owner

nyurik commented Sep 16, 2020

@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 :)

@kd7lxl
Copy link

kd7lxl commented Oct 2, 2020

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?

@nyurik
Copy link
Owner

nyurik commented Oct 2, 2020

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

@kd7lxl
Copy link

kd7lxl commented Oct 2, 2020

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

@oprypin
Copy link

oprypin commented Feb 8, 2021

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

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

No branches or pull requests

4 participants