PR to test workflow #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: delete preview on PR close | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
delete_preview: | |
runs-on: ubuntu-latest | |
env: | |
PR_PATH: pull/${{github.event.number}} | |
steps: | |
- name: Checkout website repo | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Delete preview | |
run: | | |
git rm -r ${{ env.PR_PATH }} | |
git commit -m "Delete preview for PR #${{ github.event.number }}" | |
git push origin gh-pages | |
- name: Comment on PR | |
uses: hasura/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
number: ${{ github.event.number }} | |
id: deploy-preview | |
message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/" |