rossjrw / pr-preview-action

GitHub Action that deploys a pull request preview to GitHub Pages, similar to Vercel and Netlify, and cleans up after itself.
https://github.com/marketplace/actions/deploy-pr-preview
MIT License
287 stars 46 forks source link

Cleanup is not happening as it should on PR close #76

Closed xaviergmail closed 9 months ago

xaviergmail commented 9 months ago

We currently have 200+ orphaned directories under our PR previews. The action runs, but nothing is being deleted. Here is the output:


Checking configuration and starting deployment… 🚦
Deploying using Deploy Token… 🔑
Configuring git…
/usr/bin/git config --global --add safe.directory /home/runner/work/vision-web/vision-web
/usr/bin/git config user.name xaviergmail
/usr/bin/git config user.email xaviergmail@users.noreply.github.com
/usr/bin/git config core.ignorecase false
/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
/usr/bin/git remote rm origin
/usr/bin/git remote add origin ***github.com/<redacted>
Git configured… 🔧
Starting to commit changes…
/usr/bin/git ls-remote --heads ***github.com/<redacted>.git refs/heads/gh-pages
6460bcf9c7b548bce1544e269a8ee0d4e21cc652    refs/heads/gh-pages
Creating worktree…
/usr/bin/git fetch --no-recurse-submodules --depth=1 origin gh-pages
From https://github.com/<redacted>
  * branch            gh-pages   -> FETCH_HEAD
 * [new branch]      gh-pages   -> origin/gh-pages
/usr/bin/git worktree add --no-checkout --detach github-pages-deploy-action-temp-deployment-folder
Preparing worktree (detached HEAD ef1ddab)
/usr/bin/git checkout -B gh-pages origin/gh-pages
Previous HEAD position was ef1ddab Merge 47a6e8a6cdf30c80c317f0b6d0896a4b8be0995f into cb1eea009e14ea6d3f882c373f2094c4f144a4df
Switched to a new branch 'gh-pages'
branch 'gh-pages' set up to track 'origin/gh-pages'.
/usr/bin/chmod -R +rw /tmp/tmp.MoYqQjkDJm
Creating target folder if it doesn't already exist… 📌
/usr/bin/rsync -q -av --checksum --progress /tmp/tmp.MoYqQjkDJm/. github-pages-deploy-action-temp-deployment-folder/pr-previews/pr-1923 --delete --exclude CNAME --exclude .nojekyll --exclude .ssh --exclude .git --exclude .github
Checking if there are files to commit…
Running post deployment cleanup jobs… 🗑️
/usr/bin/git checkout -B github-pages-deploy-action/z4xrvq1b2
Switched to a new branch 'github-pages-deploy-action/z4xrvq1b2'
/usr/bin/chmod -R +rw github-pages-deploy-action-temp-deployment-folder
/usr/bin/git worktree remove github-pages-deploy-action-temp-deployment-folder --force
There is nothing to commit. Exiting early… 📭