File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3333 - name : Check GitHub Action changes
3434 id : check-workflows
3535 run : |
36- git fetch origin ${{ github.event.pull_request.base.sha }}
37- if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q '^.github/workflows'; then
36+ BASE_SHA="${{ github.event.pull_request.base.sha || github.event.before }}"
37+ if [ -n "$BASE_SHA" ]; then
38+ git fetch origin "$BASE_SHA" 2>/dev/null || true
39+ fi
40+
41+ # For PRs, diff against base; for pushes, use before commit
42+ if [ -n "${{ github.event.pull_request.base.sha }}" ]; then
43+ DIFF_BASE="${{ github.event.pull_request.base.sha }}"
44+ else
45+ DIFF_BASE="${{ github.event.before }}"
46+ fi
47+
48+ if git diff --name-only "$DIFF_BASE" ${{ github.sha }} 2>/dev/null | grep -q '^.github/workflows'; then
3849 echo "changed=true" >> "$GITHUB_OUTPUT"
3950 response=$(curl -sf https://api.github.com/repos/rhysd/actionlint/releases/latest)
4051 if [ $? -eq 0 ]; then
You can’t perform that action at this time.
0 commit comments