-
Notifications
You must be signed in to change notification settings - Fork 345
56 lines (47 loc) · 1.47 KB
/
wai-trigger-cleanup.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Trigger branch cleanup for WAI-APG site
on:
delete:
pull_request_target:
branches-ignore:
- "dependabot/**"
types:
- closed
jobs:
cleanup-branch-wai:
if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install @octokit/rest
run: npm install @octokit/rest
- name: Run wai-trigger-cleanup script
run: |
node scripts/wai-trigger-cleanup.js
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
OWNER: ${{ github.repository_owner }}
# reference github.event.ref for branch deletion
APG_BRANCH: ${{ github.event.ref }}
cleanup-pr-wai:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install @octokit/rest
run: npm install @octokit/rest
- name: Run wai-trigger-cleanup script
run: |
node scripts/wai-trigger-cleanup.js
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
OWNER: ${{ github.repository_owner }}
# reference github.head_ref for pull request
APG_BRANCH: ${{ github.head_ref }}