-
-
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
publish-commit-bottles: various improvements #128697
Conversation
a871f22
to
6f285ac
Compare
Seems to work: #128798 |
.github/workflows/automerge.yml
Outdated
on: | ||
workflow_run: |
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.
Another nice thing we can do with workflow_run
events is that we can use them to remove
CI-long-timeout
Using that to find another
long build
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.
This is not mergeable as-is, because the way our workflows currently run (@BrewTestBot dismisses reviews and then approves them) allows the possibility for merging PRs after an approving review from a user with no write access.
I'll break off the parts that don't have to do with automerge into a separate PR.
This will make sure we only run one of these at a time for any given PR. While we're here: - add stricter checks to make sure we don't attempt to `pr-pull` PRs that we don't want or need to - avoid looping over arrays twice when we don't need to - improve readability by relying less on workflow expression interpolation - use `GITHUB_TOKEN` more often
These are no longer needed.
20f9bce
to
a24f4b2
Compare
Maybe we can check this to determine the validity of approvals: # no approvals yet
$ gh api repos/Homebrew/homebrew-core/pulls/128697 -q .mergeable_state
blocked
# approved, with failing CI
$ gh api repos/Homebrew/homebrew-core/pulls/128536 -q .mergeable_state
unstable
# approved, with green CI
$ gh api repos/Homebrew/homebrew-core/pulls/128809 -q .mergeable_state
clean |
Nice. I'll break that off into a separate PR. Most of the changes here no longer have anything to do with automatically merging PRs. |
We cannot approve PRs using a @BrewTestBot PAT, because this doesn't work for PRs opened by @BrewTestBot. Similarly, we cannot merge PRs using `GITHUB_TOKEN` because this will not trigger our required `merge_group` checks. So, instead of using one token for both actions, let's approve PRs using `GITHUB_TOKEN` and merge PRs using a @BrewTestBot PAT.
6c1064c
to
5448c89
Compare
@@ -2,6 +2,10 @@ name: Publish and commit bottles | |||
|
|||
run-name: "Publish PR #${{ inputs.pull_request }}" | |||
|
|||
concurrency: | |||
group: ${{ github.workflow }}-${{ inputs.pull_request }} |
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.
Looks like inputs.pull_request
is showing up as blank here, so we're actually running all these jobs serially at the moment.
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.
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency says:
The expression can only use the
github
context.
I pushed my changes from #128544 to a branch here to enable testing of changes to
publish-commit-bottles
.Additional changes since then:
concurrency
inpublish-commit-bottles
based on feedback (fd30058)tests.yml
(7fdb1e8)