Skip to content

Commit f8a10e3

Browse files
committed
chore(preview_clear): 全てのプレビューがなくなる時 gh-pages ブランチを削除
1 parent 181e033 commit f8a10e3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/preview_clear.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,10 @@ jobs:
3636
esac
3737
' HEAD
3838
39-
git push -f origin gh-pages
39+
commit_count=$(git rev-list HEAD --count || true)
40+
if [ -z "$commit_count" ] || [ "$commit_count" = 0 ]; then
41+
# When no commits are left, we remove the branch
42+
git push -f origin :gh-pages
43+
else
44+
git push -f origin gh-pages
45+
fi

0 commit comments

Comments
 (0)