Skip to content

Commit f70435e

Browse files
committed
fix workflow fix
1 parent 789c2cd commit f70435e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/gempush.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@master
17+
with:
18+
fetch-depth: 2
1719

1820
- name: Check if version.rb has changed
1921
id: version_check
2022
run: |
21-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^lib/coaster/version.rb$"; then
23+
PREV_COMMIT=${{ github.event.before }}
24+
if [ -z "$PREV_COMMIT" ] || [ "$PREV_COMMIT" == "0000000000000000000000000000000000000000" ]; then
25+
PREV_COMMIT=$(git rev-parse HEAD~1)
26+
fi
27+
28+
if git diff --name-only $PREV_COMMIT ${{ github.sha }} | grep -q "^lib/coaster/version.rb$"; then
2229
echo "VERSION_CHANGED=true" >> $GITHUB_ENV
2330
else
2431
echo "VERSION_CHANGED=false" >> $GITHUB_ENV

0 commit comments

Comments
 (0)