-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (34 loc) · 1.17 KB
/
cleanup-pr-assets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This workflow removes any assets created for manual QA testing
# from the GitHub Wiki repository once a pull request is closed.
#
# See https://github.com/google/web-stories-wp/issues/1398
name: Clean up PR assets
on:
pull_request:
types: [closed]
jobs:
remove-pr:
name: Cleanup storage
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}.wiki
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
- name: Prune PR files
run: |
rm -rf "refs/pull/${{ github.event.pull_request.number }}"
git add .
git status
git diff --staged --quiet && echo 'No changes to commit; exiting!' && exit 0
git commit -m "Prune refs/pull/${{ github.event.pull_request.number }}"
git pull --rebase
git push origin master
env:
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_AUTHOR_NAME: ${{ github.actor }}
GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_COMMITTER_NAME: ${{ github.actor }}