Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/DoodleBUGSPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: DoodleBUGS PR Preview Cleanup

on:
pull_request:
types: [closed]
paths:
- 'DoodleBUGS/**'
- '.github/workflows/DoodleBUGSpreview.yml'
- '.github/workflows/DoodleBUGSPreviewCleanup.yml'

permissions:
contents: write

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}

- name: Delete DoodleBUGS preview and push changes
run: |
if [ -d "DoodleBUGS/pr-previews/$PRNUM" ]; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git rm -rf "DoodleBUGS/pr-previews/$PRNUM"
git commit -m "DoodleBUGS: Delete preview for PR $PRNUM"
git push origin gh-pages
else
echo "No DoodleBUGS preview found for PR $PRNUM"
fi
env:
PRNUM: ${{ github.event.number }}