ci: only run lint-extra job on PRs to main

All the new code appears in main (not in the release branches),
and we only want extra linter rules to apply to new code.

Disable lint-extra job if the PR is not to the main branch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-10-14 16:15:13 -07:00
parent ef90082853
commit 1c4dba693f
+2 -2
View File
@@ -42,9 +42,9 @@ jobs:
- uses: golangci/golangci-lint-action@v8 - uses: golangci/golangci-lint-action@v8
with: with:
version: v2.5 version: v2.5
# Extra linters, only checking new code from a pull request. # Extra linters, only checking new code from a pull request to main.
- name: lint-extra - name: lint-extra
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request' && github.base_ref == 'main'
run: | run: |
golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1 golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1