Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New reusable delete-preview action #8

Merged
merged 1 commit into from
Oct 5, 2022
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/delete-preview.yaml
Original file line number Diff line number Diff line change
@@ -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 }}