-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
workflows: publish approved PRs on CI completion #128817
Conversation
dac92b8
to
055a66f
Compare
055a66f
to
1b3f464
Compare
Sorry, didn't intend to click that. (I was using the mobile app.) |
9abf80b
to
4047253
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far!
This is based on one of @MikeMcQuaid's suggestions on Slack. We add an `automerge.yml` workflow that is triggered by the `workflow_run` event. We need this in order to escalate access of `GITHUB_TOKEN` from the `pull_request` and `pull_request_review` events, which can only have read access to the GitHub API. The `automerge` workflow is triggered by two events: - completion of a `CI` workflow on a pull request - approval of a pull request Because both of these events are required in order to merge, we allow the workflow to wait for a while to check if the other event occurs. The basic idea of this workflow was borrowed from the documentation on `workflow_run` events [1]. [1] https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
4047253
to
b763256
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your great work!
Ok, let's merge this while I have a few hours to watch the queue to make sure nothing 💥 |
We're seeing a number of failures, because the (outdated) CI workflow did not produce the |
This is a continuation of #128697 and #128544.
We need to now check the PR's
mergeable_state
to make sure we're merging something with a green approval (rather than a grey one).See octokit/octokit.net#1763 for more details on
mergeable_state
.