Skip to content

Commit

Permalink
Fixes docs workflow failing when no branch previews exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonb5 committed May 15, 2024
1 parent ba6f8c3 commit 1c05311
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,20 @@ jobs:
run: |
pushd $GITHUB_WORKSPACE/gh-pages
for name in `ls branch/`
do
if [[ -z "$(git show-ref --quiet ${name})" ]]
then
git rm -rf branch/${name}
fi
done
if [[ -e "$GITHUB_WORKSPACE/gh-pages/branch" ]]; then
for name in `ls branch/`
do
if [[ -z "$(git show-ref --quiet ${name})" ]]
then
git rm -rf branch/${name}
fi
done
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git commit -m "Clean up branch previews"
git push
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git commit -m "Clean up branch previews"
git push
fi
build-and-deploy:
permissions:
contents: write # for peaceiris/actions-gh-pages to push
Expand Down

0 comments on commit 1c05311

Please sign in to comment.