-
Notifications
You must be signed in to change notification settings - Fork 221
131 lines (129 loc) · 5.57 KB
/
project-automations.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Project Automations
on:
issues:
types:
- opened
- reopened
- closed
- labeled
pull_request_target:
types:
- opened
env:
ice_box: 🧊 Ice Box
new: 🆕 New
ready: 🔖 Ready
on_deck: 📨 On Deck
todo: 📋 To Do
in_progress: 🏗 In progress
in_review: 👀 In review
done: ✅ Done
gh_project_token: ${{ secrets.CANVAS_BOARD_TOKEN }}
gh_organization: Workday
gh_project_id: 4
jobs:
issue_opened_or_reopened:
name: issue_opened_or_reopened
runs-on: ubuntu-latest
if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened')
steps:
- name: Move issue to ${{ env.new }}
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
status_value: ${{ env.new }}
issue_closed:
name: issue_closed
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'closed'
steps:
- name: Moved issue to ${{ env.done }}
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
status_value: ${{ env.done }}
issue_labeled:
name: issue_labeled
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'labeled'
steps:
- name: Add Issue to Contribution Board
if: github.event.label.name == 'good first issue' || github.event.label.name == 'help wanted'
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
operation_mode: custom_field
custom_field_values: '[{\"name\": \"Contributions\",\"type\": \"single_select\",\"value\": \"Yes\"}]'
- name: Move Issue to ${{ env.in_review }}
if: github.event.label.name == 'ready for review'
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: $${{ github.event.issue.node_id }}
status_value: ${{ env.in_review }}
- name: Add Issue Type - Bug
if: github.event.label.name == 'bug'
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
operation_mode: custom_field
custom_field_values: '[{\"name\": \"Type\",\"type\": \"single_select\",\"value\": \"🐛 Bug\"}]'
- name: Add Issue Type - Epic
if: github.event.label.name == 'epic'
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
operation_mode: custom_field
custom_field_values: '[{\"name\": \"Type\",\"type\": \"single_select\",\"value\": \"⚓️ Epic\"}]'
- name: Add Issue Type - Spike
if: github.event.label.name == 'spike'
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
operation_mode: custom_field
custom_field_values: '[{\"name\": \"Type\",\"type\": \"single_select\",\"value\": \"🏐 Spike\"}]'
- name: Add Issue Type - Infrastructure
if: github.event.label.name == 'infra'
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.issue.node_id }}
operation_mode: custom_field
custom_field_values: '[{\"name\": \"Type\",\"type\": \"single_select\",\"value\": \"🧰 Infrastructure\"}]'
pr_opened:
name: pr_opened
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target' && github.event.action == 'opened'
steps:
- name: Move PR to Current Sprint
if: startsWith(github.head_ref, 'merge/') || startsWith(github.head_ref, 'dependabot/')
uses: leonsteinhaeuser/[email protected]
with:
gh_token: ${{ env.gh_project_token }}
organization: ${{ env.gh_organization }}
project_id: ${{ env.gh_project_id }}
resource_node_id: ${{ github.event.pull_request.node_id }}
operation_mode: custom_field
custom_field_values: '[{\"name\": \"Priority\",\"type\": \"single_select\",\"value\": \"🌋 Urgent\"},{\"name\": \"Sprint\",\"type\": \"iteration\",\"value\": \"@current\"},{\"name\": \"Status\",\"type\": \"single_select\",\"value\": \"👀 In review\"}]'