From 99e41a58f7a51cf1b6caa5bed58ffbe615193523 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 14 Oct 2025 16:15:13 -0700 Subject: [PATCH] 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 (cherry picked from commit 1c4dba693ffc843086781e456f5cb3aae1426430) Signed-off-by: lifubang --- .github/workflows/validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index bd711de6c..e96a07217 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -41,9 +41,9 @@ jobs: - uses: golangci/golangci-lint-action@v6 with: version: v1.64 - # 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 - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && github.base_ref == 'main' run: | golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1