From 1c4dba693ffc843086781e456f5cb3aae1426430 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 --- .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 43bfc293c..c3a8452fd 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -42,9 +42,9 @@ jobs: - uses: golangci/golangci-lint-action@v8 with: 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 - 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