From 98fd943551abcd4fa61f55d4a6c7851404c61a20 Mon Sep 17 00:00:00 2001 From: Bryan Cox Date: Tue, 5 May 2026 16:51:36 -0400 Subject: [PATCH] fix(ci): use PR base SHA for api-lint diff in GHA The api-lint Makefile target uses --new-from-rev=${PULL_BASE_SHA} to only report issues on lines changed by the PR. When PULL_BASE_SHA is not set, the Makefile defaults to origin/main. For PRs targeting release branches, this causes the linter to diff against main instead of the target branch, flagging pre-existing divergences as new issues. This broke all release-4.22 PRs after PR #8166 changed AutoNode/Karpenter fields on main. Set PULL_BASE_SHA to the PR's actual base commit SHA, matching the pattern already used by the gitlint workflow. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/lint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 76b953ebbe6..50fc80189c2 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -23,3 +23,5 @@ jobs: touch hack/tools/bin/golangci-lint hack/tools/bin/kube-api-linter.so fi - run: make lint + env: + PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}