diff --git a/.github/workflows/gh-pages-cleanup.yaml b/.github/workflows/gh-pages-cleanup.yaml index 5047ebe..3b36b0e 100644 --- a/.github/workflows/gh-pages-cleanup.yaml +++ b/.github/workflows/gh-pages-cleanup.yaml @@ -16,10 +16,10 @@ jobs: - name: Delete directory in gh-pages if: github.event.ref_type == 'branch' run: | + git fetch --all + git checkout gh-pages branchName=$(echo "${{ github.event.ref }}" | sed -e 's,^refs/heads/,,') if [ -d "./.unlighthouse/${branchName}" ]; then - git fetch --all - git checkout gh-pages git rm -rf --ignore-unmatch "${branchName}" git commit -m "Cleanup directory for deleted branch ${branchName}" git push origin gh-pages