File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,20 +11,24 @@ permissions:
1111
1212jobs :
1313 lint :
14- if : github.event_name == 'pull_request' || (github.event_name == 'pull_request_review' && github. event.review.state == 'approved')
14+ if : github.event.review.state == 'approved'
1515 name : Lint Code Base
1616 runs-on : ubuntu-latest
1717 steps :
1818 - name : Checkout Code
1919 uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2020 with :
21- # Check out the head of the PR specifically
22- ref : ${{ github.event.pull_request.head.sha }}
21+ # Check out the PR head through GitHub's pull ref for review events
22+ ref : refs/pull/ ${{ github.event.pull_request.number }}/head
2323 # Full git history is needed to get a proper list of changed files within `super-linter`
2424 fetch-depth : 0
2525 # Disable credential persistence to harden the runner
2626 persist-credentials : false
2727
28+ - name : Set lint SHA from checked-out HEAD
29+ id : set_lint_sha
30+ run : echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
31+
2832 - name : Fetch base branch for diff
2933 run : git fetch --no-tags --prune origin "+refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}"
3034
3337 env :
3438 VALIDATE_ALL_CODEBASE : false
3539 DEFAULT_BRANCH : ${{ github.event.pull_request.base.ref }}
36- GITHUB_SHA : ${{ github.event.pull_request.head .sha }}
40+ GITHUB_SHA : ${{ steps.set_lint_sha.outputs .sha }}
3741 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments