Skip to content

Commit 05b5c75

Browse files
committed
Support linting "only-new-issues" from merge queue
1 parent 98ac4f1 commit 05b5c75

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/golangci_lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Golangci-lint
22

3-
on: pull_request
3+
on: [pull_request, merge_group]
44

55
jobs:
66
golangci-lint:
@@ -9,11 +9,14 @@ jobs:
99
id-token: write
1010
contents: read
1111
actions: read
12+
pull-requests: read
1213
steps:
1314
- name: Checkout code
1415
uses: actions/checkout@v5
1516
with:
1617
persist-credentials: false
18+
# Fetch full history for merge_group to ensure base ref exists for comparison.
19+
fetch-depth: ${{ github.event_name == 'merge_group' && 0 || 1 }}
1720

1821
- name: Get golangci-lint version from asdf
1922
id: get-version
@@ -22,7 +25,7 @@ jobs:
2225
echo "version=${version}" | tee -a "$GITHUB_OUTPUT"
2326
2427
- name: golangci-lint
25-
if: ${{ always() && !contains(join(github.event.pull_request.labels.*.name, ' '), 'allow-lint-issues') }}
28+
if: ${{ (github.event_name == 'pull_request' && !contains(join(github.event.pull_request.labels.*.name, ' '), 'allow-lint-issues')) || github.event_name == 'merge_group' }}
2629
# NOTE: Keep this version in sync with ACTION_CI_LINT_GO_GIT_TAG in ./script/lint.sh
2730
uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/3.0.0
2831
with:

0 commit comments

Comments
 (0)