No check suite event for foreign pull reuqests #24622
-
I noticed that the check_suite event that GitHub apps can subscribe to is only triggered for new code push to the repo the app is installed on. The event is not created when another user creates a fork to submit a patch to your repo. Here is an example, where this happend: jazzband/pip-tools#784 (comment) Everything is setup following this guide: https://developer.github.com/apps/quickstart-guides/creating-ci-tests-with-the-checks-api/ I think it’t a stretch to say, that you want your CI to run for contributions from other users too. How do I make this work for all pull requests no matter the origin, or better, can we please just sent the check_suite event for all pull requests? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
The team is definitely aware of this problem and friction point, and it’s something they want to improve and resolve. The problem is not trivial, so a full solution from our end will probably not happen in the near future. For now, the recommended workaround is that in addition to listening for check_suite events – your App also listens to pull_request events which are triggered when a pull request is updated (the synchronize event). If you receive the event for a pull request made from a fork – you can use that to manually create check runs for the latest commit in the pull request. I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
For those like me who might find this and wonder how the suggested workaround affects the tutorial. In Step 1.1 Updating app permissions, perform the following additional steps:
In Step 1.2 Add Event Handling, paste this modified version of the check_suite route so that it can also handle a pull_request event.
In Step 1.3 Creating a check run, under helpers do, add this create_check_run_from_pull_request method:
In Troubleshooting, encourage Github to acknowledge this limitation and workaround. |
Beta Was this translation helpful? Give feedback.
-
@lee-dohm do I read this correctly that it’s the same behavior for “normal pull requests” - that is standard PRs open from the main repo itself (no forks). I’m basically experiencing the same behavior, that is not receiving any check_suite events when the PR Is created; only when a new code is pushed to the corresponding branch (which misses the very first time the PR is initially created). |
Beta Was this translation helpful? Give feedback.
-
Great alternative! Thanks, |
Beta Was this translation helpful? Give feedback.
-
Doing this, can you rerun a check_run individual ? Because I do not have a way to checkout files from a revision number, when this revision belongs to a fork. Any one found a solution for this problem? |
Beta Was this translation helpful? Give feedback.
-
Running into this today. Very disappointing behavior from the checks API. |
Beta Was this translation helpful? Give feedback.
For those like me who might find this and wonder how the suggested workaround affects the tutorial.
In Step 1.1 Updating app permissions, perform the following additional steps:
In Step 1.2 Add Event Handling, paste this modified version of the check_suite route so that it can also handle a pull_request event.