Skip to content

Commit

Permalink
ci: Run mergeability and cargo-fmt workflows in merge queue
Browse files Browse the repository at this point in the history
The workflows are marked as required, which blocks the merge queue if we
don't run them. Let's trigger the workflows on "merge_group", too.

Signed-off-by: Quentin Monnet <[email protected]>
  • Loading branch information
qmonnet committed Nov 21, 2024
1 parent 5888a7a commit 983fc73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/lint-cargo-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: "lint-cargo-fmt.yml"

on:
pull_request: {}
merge_group:
types: ["checks_requested"]

concurrency:
group: "${{ github.workflow }}:${{ github.event.pull_request.number }}"
Expand All @@ -13,6 +15,9 @@ jobs:
format-check:
name: "Check formatting for Rust code"
runs-on: "ubuntu-latest"
# Skip this job in merge group checks; but we need the workflow to run,
# given that the status check is required for merging.
if: "${{ github.event.pull_request }}"
steps:
- name: "Install Rust toolchain"
uses: "dtolnay/rust-toolchain@stable"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/mergeability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ name: "mergeability.yml"
on:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]
merge_group:
types: ["checks_requested"]

jobs:
check-labels:
runs-on: "ubuntu-latest"
name: "Check mergeability based on labels"
# Skip this job in merge group checks; but we need the workflow to run,
# given that the status check is required for merging.
if: "${{ github.event.pull_request }}"
steps:
- if: ${{ contains(github.event.*.labels.*.name, 'dont-merge') }}
name: "Fail test due to 'dont-merge' label presence"
Expand Down

0 comments on commit 983fc73

Please sign in to comment.