mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 10:20:59 -05:00
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
name: Clean Preview
|
|
|
|
#! Safety:
|
|
#! this workflow should not execute any untrusted input at all
|
|
#! see the docs on `pull_request_target` for more
|
|
on:
|
|
pull_request_target:
|
|
types: [unlabeled]
|
|
|
|
jobs:
|
|
clean:
|
|
runs-on: ubuntu-latest
|
|
if: github.event.label.name == 'use-preview'
|
|
env:
|
|
BASE: refs/pull/${{ github.event.pull_request.number }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: build-previews
|
|
persist-credentials: false
|
|
|
|
- name: clean previews
|
|
run: rm -rf "$BASE"
|
|
|
|
- name: publish cleaned previews
|
|
uses: JamesIves/github-pages-deploy-action@4.1.5
|
|
with:
|
|
folder: .
|
|
branch: build-previews
|
|
commit-message: "Cleaning up build result for #${{ github.event.pull_request.number }}"
|
|
|
|
- name: send comment
|
|
uses: marocchino/sticky-pull-request-comment@v2
|
|
with:
|
|
header: Preview environment
|
|
message: |
|
|
## Preview environment
|
|
There is no longer a preview enviroment for this pull request due to the `use-preview` label being removed
|