Skip to content

Commit 50c1750

Browse files
authored
MINOR - Enable merge group GH event (#27371)
* chore: added merge_group for github merge queue * chore: remove unnecessary merger group on team labeler * fix: added gates for merge queue and pull request events
1 parent 0fac6b9 commit 50c1750

12 files changed

Lines changed: 68 additions & 50 deletions

.github/workflows/integration-tests-mysql-elasticsearch.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
name: Integration Tests - MySQL + Elasticsearch
1313

1414
on:
15+
merge_group:
1516
workflow_dispatch:
1617
push:
1718
branches:
@@ -96,7 +97,7 @@ jobs:
9697
- name: Checkout
9798
uses: actions/checkout@v4
9899
with:
99-
ref: ${{ github.event.pull_request.head.sha }}
100+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
100101

101102
- name: Cache Maven dependencies
102103
id: cache-output

.github/workflows/integration-tests-postgres-opensearch.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
name: Integration Tests - PostgreSQL + OpenSearch
1313

1414
on:
15+
merge_group:
1516
workflow_dispatch:
1617
push:
1718
branches:
@@ -96,7 +97,7 @@ jobs:
9697
- name: Checkout
9798
uses: actions/checkout@v4
9899
with:
99-
ref: ${{ github.event.pull_request.head.sha }}
100+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
100101

101102
- name: Cache Maven dependencies
102103
id: cache-output

.github/workflows/java-checkstyle.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
name: Java Checkstyle
1313

1414
on:
15+
merge_group:
1516
# Trigger analysis when pushing in master or pull requests, and when creating
1617
# a pull request.
1718
push:
@@ -68,7 +69,7 @@ jobs:
6869
- name: Checkout
6970
uses: actions/checkout@v4
7071
with:
71-
ref: ${{ github.event.pull_request.head.sha }}
72+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
7273

7374
- name: Set up JDK 21
7475
uses: actions/setup-java@v4
@@ -86,7 +87,7 @@ jobs:
8687
git diff-files --quiet
8788
8889
- name: Create a comment in the PR with the instructions
89-
if: steps.git.outcome != 'success'
90+
if: ${{ steps.git.outcome != 'success' && github.event_name == 'pull_request_target' }}
9091
uses: peter-evans/create-or-update-comment@v1
9192
with:
9293
issue-number: ${{ github.event.pull_request.number }}

.github/workflows/openmetadata-service-unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
name: OpenMetadata Service Unit Tests
1313

1414
on:
15+
merge_group:
1516
workflow_dispatch:
1617
push:
1718
branches:

.github/workflows/playwright-postgresql-e2e.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
name: Postgresql PR Playwright E2E Tests
1616
on:
17+
merge_group:
1718
workflow_dispatch:
1819
pull_request_target:
1920
types:
@@ -66,7 +67,7 @@ jobs:
6667
- name: Checkout
6768
uses: actions/checkout@v4
6869
with:
69-
ref: ${{ github.event.pull_request.head.sha }}
70+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
7071

7172
- name: Setup JDK 21
7273
uses: actions/setup-java@v4
@@ -120,7 +121,7 @@ jobs:
120121
- name: Checkout
121122
uses: actions/checkout@v4
122123
with:
123-
ref: ${{ github.event.pull_request.head.sha }}
124+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
124125

125126
- name: Download Maven build artifact
126127
uses: actions/download-artifact@v4

.github/workflows/py-checkstyle.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ name: Python Checkstyle
1414
# read-write repo token
1515
# access to secrets
1616
on:
17+
merge_group:
1718
pull_request_target:
1819
types: [labeled, opened, synchronize, reopened, ready_for_review]
1920
paths-ignore:
@@ -56,7 +57,7 @@ jobs:
5657
- name: Checkout
5758
uses: actions/checkout@v4
5859
with:
59-
ref: ${{ github.event.pull_request.head.sha }}
60+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
6061

6162
- name: Set up Python 3.10
6263
uses: actions/setup-python@v5
@@ -84,7 +85,7 @@ jobs:
8485
make py_format_check
8586
8687
- name: Create a comment in the PR with the instructions
87-
if: steps.style.outcome != 'success'
88+
if: ${{ steps.style.outcome != 'success' && github.event_name == 'pull_request_target' }}
8889
uses: peter-evans/create-or-update-comment@v1
8990
with:
9091
issue-number: ${{ github.event.pull_request.number }}

.github/workflows/py-tests-postgres.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
name: py-tests-postgres
1313
on:
14+
merge_group:
1415
workflow_dispatch:
1516
pull_request_target:
1617
types: [labeled, opened, synchronize, reopened, ready_for_review]
@@ -103,7 +104,7 @@ jobs:
103104
- name: Checkout
104105
uses: actions/checkout@v4
105106
with:
106-
ref: ${{ github.event.pull_request.head.sha }}
107+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
107108

108109
- name: Setup Openmetadata Test Environment
109110
uses: ./.github/actions/setup-openmetadata-test-environment

.github/workflows/py-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
name: py-tests
1313
on:
14+
merge_group:
1415
workflow_dispatch:
1516
pull_request_target:
1617
types: [labeled, opened, synchronize, reopened, ready_for_review]
@@ -89,7 +90,7 @@ jobs:
8990
- name: Checkout
9091
uses: actions/checkout@v4
9192
with:
92-
ref: ${{ github.event.pull_request.head.sha }}
93+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
9394

9495
- name: Setup Openmetadata Test Environment
9596
uses: ./.github/actions/setup-openmetadata-test-environment
@@ -177,7 +178,7 @@ jobs:
177178
- name: Checkout
178179
uses: actions/checkout@v4
179180
with:
180-
ref: ${{ github.event.pull_request.head.sha }}
181+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
181182

182183
- name: Setup Openmetadata Test Environment
183184
uses: ./.github/actions/setup-openmetadata-test-environment
@@ -230,7 +231,7 @@ jobs:
230231
- name: Checkout
231232
uses: actions/checkout@v4
232233
with:
233-
ref: ${{ github.event.pull_request.head.sha }}
234+
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}
234235
fetch-depth: 0
235236
filter: blob:none
236237

.github/workflows/typescript-type-generation.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: TypeScript Type Generation
22

33
on:
4+
merge_group:
45
pull_request_target:
56
types: [opened, synchronize, reopened, labeled, ready_for_review]
67
paths:
@@ -101,8 +102,11 @@ jobs:
101102
PR_DETAILS_HEAD_REF: ${{ steps.pr-details.outputs.head_ref }}
102103
INPUT_BRANCH: ${{ github.event.inputs.branch }}
103104
GITHUB_REF: ${{ github.ref }}
105+
GITHUB_SHA_VAL: ${{ github.sha }}
104106
run: |
105-
if [ "$IS_FORK" == "true" ] && [ "$EVENT_NAME" == "pull_request_target" ]; then
107+
if [ "$EVENT_NAME" == "merge_group" ]; then
108+
echo "ref=$GITHUB_SHA_VAL" >> $GITHUB_OUTPUT
109+
elif [ "$IS_FORK" == "true" ] && [ "$EVENT_NAME" == "pull_request_target" ]; then
106110
echo "ref=$PR_HEAD_SHA" >> $GITHUB_OUTPUT
107111
elif [ "$EVENT_NAME" == "pull_request_target" ]; then
108112
echo "ref=$PR_HEAD_REF" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)