From 475d8f93309ccca01afc019e2fbafeeddf690048 Mon Sep 17 00:00:00 2001 From: Brian Rose Date: Wed, 5 Oct 2022 17:11:33 -0400 Subject: [PATCH] New reusable delete-preview action --- .github/workflows/delete-preview.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/delete-preview.yaml diff --git a/.github/workflows/delete-preview.yaml b/.github/workflows/delete-preview.yaml new file mode 100644 index 0000000..9674446 --- /dev/null +++ b/.github/workflows/delete-preview.yaml @@ -0,0 +1,24 @@ +name: delete-preview + +on: + workflow_call: + +jobs: + delete: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v3 + with: + ref: gh-pages + - name: Delete preview files + run: | + rm -rf _preview/${{ github.event.pull_request.number }} + - name: Commit the changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: gh-pages + commit_message: Delete preview for pull request \#${{ github.event.pull_request.number }} \ No newline at end of file