From ad30cb20dbecc7d8537cf3af24b7e3503dc55bd3 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Mon, 12 Jun 2023 02:39:32 +0200 Subject: [PATCH] fix: Order of `git` fetch and checkout --- .github/workflows/gh-pages-cleanup.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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