Skip to content

Commit df58461

Browse files
authored
add workflow to delete PR preview from server storage (#278)
This PR adds a workflow to issue to the preview server a deletion when the PR is closed. The workflow is added to `pull_request_target`, such that the workflow is defined in the base branch, allowing it to use the token to communicate with the preview server.
1 parent 7cbd102 commit df58461

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Delete PR preview
2+
on:
3+
pull_request_target:
4+
branches: ['main']
5+
types: ['closed']
6+
7+
jobs:
8+
preview_delete:
9+
name: Delete preview
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: delete-preview
13+
run: |
14+
curl --fail -X DELETE -H "Authorization: Bearer ${{ secrets.UPLOAD_TOKEN }}" https://docs.tds.cscs.ch/upload?path={{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)