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
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine changed files (PR vs push)
|
# Determine changed files (PR vs push vs manual dispatch)
|
||||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
||||||
HEAD_SHA="${{ github.event.pull_request.head.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
|
else
|
||||||
BASE_SHA="$(git rev-parse HEAD~1 || echo '')"
|
# For workflow_dispatch and other events treat as "all files changed"
|
||||||
HEAD_SHA="$(git rev-parse HEAD)"
|
BASE_SHA=""
|
||||||
|
HEAD_SHA="$(git rev-parse HEAD 2>/dev/null || true)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$BASE_SHA" ]]; then
|
if [[ -n "$BASE_SHA" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user