File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 2828 - name : Compute merge-base (BASE_SHA)
2929 shell : bash
3030 run : |
31- # Be strict about failures, but avoid -u (unbound var) because we build BASE_SHA progressively
3231 set -e -o pipefail
33-
3432 BASE_REF="origin/${{ github.base_ref }}"
35-
36- echo "HEAD commit:"
37- git show -s --oneline HEAD
38- echo "Base ref:"
39- git show -s --oneline "$BASE_REF" || { echo "Missing $BASE_REF"; exit 1; }
40-
41- # Try fork-point first; if it fails or is empty, fall back to plain merge-base
42- BASE_SHA=""
43- if BASE_SHA=$(git merge-base --fork-point "$BASE_REF" HEAD 2>/dev/null); then
44- :
45- fi
46- if [[ -z "$BASE_SHA" ]]; then
47- BASE_SHA=$(git merge-base HEAD "$BASE_REF")
48- fi
49-
33+ BASE_SHA=$(git merge-base --fork-point "$BASE_REF" HEAD 2>/dev/null)
5034 echo "BASE_SHA=$BASE_SHA"
51- echo "BASE_SHA=$BASE_SHA" >> "$GITHUB_ENV"
You can’t perform that action at this time.
0 commit comments