forked from hackforla/website
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 2.42 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
name: Pull Request Trigger
on:
pull_request_target:
types: [opened, closed]
branches:
- 'gh-pages'
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/github-project-automation-plus@v0.8.1
with:
project: Project Board
column: 'PR Needs review (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
# 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/github-project-automation-plus@v0.8.1
with:
project: Project Board
column: 'test-approved-by-reviewer (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
# 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/github-project-automation-plus@v0.8.1
with:
project: Project Board
column: 'test-approved-by-reviewer (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
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/github-project-automation-plus@v0.8.1
with:
project: Project Board
column: 'PR Needs review (Automated Column, do not place items here manually)'
repo-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
action: delete