Skip to content

Commit

Permalink
ci: add validation to clean-preview (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliodialpad authored Oct 31, 2023
1 parent bbbdc4f commit 21549cf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/clean-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [closed]

jobs:
clean:
clean-preview:
runs-on: ubuntu-latest

steps:
Expand All @@ -16,7 +16,11 @@ jobs:
git config user.name github-actions
git config user.email github-actions@github.com
git pull
rm -rf deploy-previews/pr-${{ github.event.pull_request.number }}
git add -A
git commit -m "deploy preview cleanup"
git push
if [ -d "deploy-previews/pr-${{ github.event.pull_request.number }}" ]; then
rm -rf deploy-previews/pr-${{ github.event.pull_request.number }}
git add -A
git commit -m "deploy preview cleanup"
git push
else
echo "No preview was created"
fi

0 comments on commit 21549cf

Please sign in to comment.