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

Prepare repo for enabling merge queue #215

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: Build Book
on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Kani

on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/pr_approval.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
# This workflow checks that the PR has been approved by 2+ members of the committee listed in `pull_requests.toml`.
celinval marked this conversation as resolved.
Show resolved Hide resolved
celinval marked this conversation as resolved.
Show resolved Hide resolved
#
# Run this pull request when a request review is submitted / dismissed.
carolynzech marked this conversation as resolved.
Show resolved Hide resolved
celinval marked this conversation as resolved.
Show resolved Hide resolved
# Note that an approval can be dismissed, and this can affect the job status.
# We currently trust that contributors won't make significant changes to their PRs after approval, so we accept
# changes after approval.
celinval marked this conversation as resolved.
Show resolved Hide resolved
#
# We still need to run this in the case of a merge group, since it is a required step. In that case, the workflow
# is a NOP.
name: Check PR Approvals

# For now, the workflow gets triggered only when a review is submitted
# This technically means, a PR with zero approvals can be merged by the rules of this workflow alone
# To protect against that scenario, we can turn on number of approvals required to 2 in the github settings
# of the repository
on:
merge_group:
pull_request:
celinval marked this conversation as resolved.
Show resolved Hide resolved
pull_request_review:
types: [submitted]
types: [submitted, dismissed]

jobs:
check-approvals:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
if: ${{ github.event_name != 'merge_group' }}

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

- name: Check PR Relevance and Approvals
uses: actions/github-script@v6
if: ${{ github.event_name != 'merge_group' }}
with:
script: |
const fs = require('fs');
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rustc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Rust Tests
on:
workflow_dispatch:
merge_group:
pull_request:
branches: [ main ]
push:
Expand Down
Loading