Skip to content

Commit 6928d22

Browse files
celinvalcarolynzechtautschnig
authored
Prepare repo for enabling merge queue (#215)
Add `merge_group` as a trigger for our workflows. For the review check workflow, I also added a review dismissed option, and for the `merge_group` case, the workflow does nothing. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Carolyn Zech <[email protected]> Co-authored-by: Michael Tautschnig <[email protected]>
1 parent 6077459 commit 6928d22

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.github/workflows/book.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Build Book
44
on:
55
workflow_dispatch:
6+
merge_group:
67
pull_request:
78
branches: [ main ]
89
push:

.github/workflows/kani.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Kani
22

33
on:
44
workflow_dispatch:
5+
merge_group:
56
pull_request:
67
branches: [ main ]
78
push:

.github/workflows/pr_approval.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
1+
# This workflow checks that the PR has been approved by 2+ members of the committee listed in `pull_requests.toml`.
2+
#
3+
# Run this action when a pull request review is submitted / dismissed.
4+
# Note that an approval can be dismissed, and this can affect the job status.
5+
# We currently trust that contributors won't make significant changes to their PRs after approval, so we accept
6+
# changes after approval.
7+
#
8+
# We still need to run this in the case of a merge group, since it is a required step. In that case, the workflow
9+
# is a NOP.
110
name: Check PR Approvals
2-
3-
# For now, the workflow gets triggered only when a review is submitted
4-
# This technically means, a PR with zero approvals can be merged by the rules of this workflow alone
5-
# To protect against that scenario, we can turn on number of approvals required to 2 in the github settings
6-
# of the repository
711
on:
12+
merge_group:
813
pull_request_review:
9-
types: [submitted]
14+
types: [submitted, dismissed]
1015

1116
jobs:
1217
check-approvals:
1318
runs-on: ubuntu-latest
1419
steps:
1520
- name: Checkout repository
1621
uses: actions/checkout@v2
22+
if: ${{ github.event_name != 'merge_group' }}
1723

1824
- name: Install TOML parser
1925
run: npm install @iarna/toml
26+
if: ${{ github.event_name != 'merge_group' }}
2027

2128
- name: Check PR Relevance and Approvals
2229
uses: actions/github-script@v6
30+
if: ${{ github.event_name != 'merge_group' }}
2331
with:
2432
script: |
2533
const fs = require('fs');

.github/workflows/rustc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name: Rust Tests
55
on:
66
workflow_dispatch:
7+
merge_group:
78
pull_request:
89
branches: [ main ]
910
push:

0 commit comments

Comments
 (0)