fix set -euo pipefail failure
This commit is contained in:
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -40,13 +40,18 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Determine changed files (PR vs push)
|
||||
# Determine changed files (PR vs push vs manual dispatch)
|
||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
||||
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
||||
elif [[ "${{ github.event_name }}" == "push" ]]; then
|
||||
# For push events try to get the previous commit; fall back to empty
|
||||
BASE_SHA="$(git rev-parse HEAD~1 2>/dev/null || true)"
|
||||
HEAD_SHA="$(git rev-parse HEAD 2>/dev/null || true)"
|
||||
else
|
||||
BASE_SHA="$(git rev-parse HEAD~1 || echo '')"
|
||||
HEAD_SHA="$(git rev-parse HEAD)"
|
||||
# For workflow_dispatch and other events treat as "all files changed"
|
||||
BASE_SHA=""
|
||||
HEAD_SHA="$(git rev-parse HEAD 2>/dev/null || true)"
|
||||
fi
|
||||
|
||||
if [[ -n "$BASE_SHA" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user