Skip to content

Commit bea3cba

Browse files
committed
ci: re-enable merge_group and skip jobs for merge queue
GitHub Actions does not allow required status checks to differ between pull requests and merge queue runs. To work around this, the pull request workflow must run for merge_group events, but certain jobs— specifically those marked as required—need to be skipped to avoid conflicts or redundant execution. Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
1 parent 34129fd commit bea3cba

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/pull-request-checks.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Pull Request Checks
33
on:
44
workflow_dispatch:
55
pull_request:
6-
6+
merge_group:
77
env:
88
CARGO_TERM_COLOR: always
99

@@ -24,6 +24,7 @@ jobs:
2424
changes:
2525
name: Filter changes
2626
runs-on: ubuntu-22.04
27+
if: ${{ github.event_name != 'merge_group' }}
2728
# Set job outputs to values from filter step
2829
outputs:
2930
rust: ${{ steps.filter.outputs.rust || 'true' }}
@@ -42,6 +43,7 @@ jobs:
4243
- 'crates/**'
4344
- 'plugins/**'
4445
- 'Cargo.*'
46+
- '**/Cargo.toml'
4547
workflows:
4648
- '.github/workflows/**'
4749
docs:
@@ -53,9 +55,8 @@ jobs:
5355
check-lockfile-uptodate:
5456
name: Check whether Cargo.lock is up to date
5557
runs-on: ubuntu-22.04
56-
if: ${{ github.event_name == 'pull_request' }}
57-
outputs:
58-
locks: ${{ steps.filter.outputs.locks }}
58+
needs: changes
59+
if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true' }}
5960
steps:
6061
- uses: actions/checkout@v4
6162

@@ -74,15 +75,7 @@ jobs:
7475

7576
- uses: Swatinem/rust-cache@v2
7677

77-
- uses: dorny/paths-filter@v3
78-
id: filter
79-
with:
80-
filters: |
81-
locks:
82-
- '**/Cargo.toml'
83-
8478
- name: Check whether lockfile is up to date
85-
if: steps.filter.outputs.locks == 'true'
8679
run: cargo check --locked
8780

8881
udeps:

0 commit comments

Comments
 (0)