Skip to content

Commit 73b8f1d

Browse files
fix: add GITHUB_BEFORE_SHA to super-linter configuration to prevent failures on shallow repositories
1 parent 0b5c534 commit 73b8f1d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/linter.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ jobs:
4848
DEFAULT_BRANCH: main
4949
FILTER_REGEX_EXCLUDE: dist/**/*
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
# Explicitly provide the base SHA so super-linter does not try to
52+
# derive an unreachable ancestor commit like `<sha>~360` which has
53+
# caused failures on shallow or young repositories.
54+
# For pull_request events use the PR base; for push events fall back
55+
# to the `before` SHA from the push payload.
56+
GITHUB_BEFORE_SHA:
57+
${{ github.event.pull_request.base.sha || github.event.before }}
5158
LINTER_RULES_PATH: .
5259
VALIDATE_ALL_CODEBASE: true
5360
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false

0 commit comments

Comments
 (0)