Skip to content

Commit 1c4dba6

Browse files
committed
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 <[email protected]>
1 parent ef90082 commit 1c4dba6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/validate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
- uses: golangci/golangci-lint-action@v8
4343
with:
4444
version: v2.5
45-
# Extra linters, only checking new code from a pull request.
45+
# Extra linters, only checking new code from a pull request to main.
4646
- name: lint-extra
47-
if: github.event_name == 'pull_request'
47+
if: github.event_name == 'pull_request' && github.base_ref == 'main'
4848
run: |
4949
golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1
5050

0 commit comments

Comments
 (0)