Skip to content

Commit 1b70c04

Browse files
committed
use head on push if sha empty?
1 parent 02f169f commit 1b70c04

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ jobs:
8383
echo "DEBUG: push"
8484
BASE_SHA=$GITHUB_EVENT_BEFORE
8585
fi
86+
if [[ -z "$BASE_SHA" ]]; then
87+
echo "branch doesnt exist? using HEAD^"
88+
BASE_SHA=$(git rev-parse HEAD^)
89+
fi
8690
echo "BASE_SHA=$BASE_SHA" >> $GITHUB_ENV
8791
echo "Using BASE_SHA=$BASE_SHA"
8892

0 commit comments

Comments
 (0)