forked from hackforla/website
-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (60 loc) · 2.41 KB
/
pull-request-trigger.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
57
58
59
60
61
62
63
64
65
66
67
68
name: Pull Request Trigger
on:
pull_request_target:
types: [opened, closed]
branches:
- 'gh-pages'
- 'check-consolidated-5944'
jobs:
# Run an echo to confirm that the action was triggered
Hello-World:
runs-on: ubuntu-latest
steps:
- run: echo "🍺 This job was automatically triggered by a ${{ github.event_name }} event!!!"
# Moves newly opened PRs onto Project Board in column 'PR Needs review...'
Move-New-PRs-To-Project-Board:
runs-on: ubuntu-latest
if: ${{ github.event.action == 'opened' }}
steps:
- name: Move Opened PR to Project Board
uses: alex-page/[email protected]
with:
project: Project Board
column: 'PR Needs review (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.TEST_GHAS }}
# Gathers merged PRs from every location and moves to column 'test-approved-by-reviewer...'
Gather-Merged-PRs:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true }}
steps:
- name: Gather Merged PRs
uses: alex-page/[email protected]
with:
project: Project Board
column: 'test-approved-by-reviewer (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.TEST_GHAS }}
# Deletes merged PRs from column 'test-approved-by-reviewer...' after 'needs: Gather-Merged-PRs'
Delete-Merged-PRs:
needs: Gather-Merged-PRs
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true }}
steps:
- name: Delete Merged PRs
uses: alex-page/[email protected]
with:
project: Project Board
column: 'test-approved-by-reviewer (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.TEST_GHAS }}
action: delete
# Removes PRs that are closed and not merged
Delete-Closed-And-Unmerged-PRs:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == false && github.event.action == 'closed' }}
steps:
- name: Delete Closed and Unmerged PRs
uses: alex-page/[email protected]
with:
project: Project Board
column: 'PR Needs review (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.TEST_GHAS }}
action: delete