forked from conda/constructor
-
Notifications
You must be signed in to change notification settings - Fork 1
213 lines (208 loc) · 7.23 KB
/
boards.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: Automate Boards
on:
# NOTE: github.event context is issues payload:
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues
issues:
types: [opened, labeled, unlabeled]
env:
BACKLOG_LBL: backlog
SPRINT_LBL: sprint
# these variables cannot be used in if expressions
# see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
TRIAGING_ID: 4
TRIAGING_URL: https://api.github.com/projects/13697310
BACKLOG_ID: 5
BACKLOG_URL: https://api.github.com/projects/13697370
SPRINT_ID: 8
SPRINT_URL: https://api.github.com/projects/13829490
jobs:
# new -> Triaging[New]
to_triaging:
# if new issue (or old issue marked as [stale::recovered]) and not [backlog] or [sprint]
if: >-
!github.event.repository.fork
&& github.event_name == 'issues'
&& (
(
github.event.sender.login != 'conda-bot'
&& github.event.action == 'opened'
)
|| (
github.event.action == 'labeled'
&& github.event.label.name == 'stale::recovered'
)
)
&& !contains(github.event.issue.labels.*.name, 'backlog')
&& !contains(github.event.issue.labels.*.name, 'sprint')
runs-on: ubuntu-latest
steps:
# add to Triaging board
- uses: alex-page/[email protected]
with:
action: add # if not present
project: Triaging
column: New
repo-token: ${{ secrets.PROJECT_TOKEN }}
# new -> Backlog[Unplanned]
# Triaging[Ready] -> Backlog[Unplanned]
# Sprint[To Do] -> Backlog[Do Next]
to_backlog:
# if new issue with [backlog]
# if labeled [backlog]
# if added to Backlog board
# if unlabeled [sprint]
# if removed from Sprint board
if: >-
!github.event.repository.fork
&& github.event.sender.login != 'conda-bot'
&& github.event.issue.state == 'open'
&& (
(
github.event_name == 'issues'
&& github.event.action == 'opened'
&& contains(github.event.issue.labels.*.name, 'backlog')
&& !contains(github.event.issue.labels.*.name, 'sprint')
)
|| (
github.event_name == 'issues'
&& github.event.action == 'labeled'
&& github.event.label.name == 'backlog'
)
|| (
github.event_name == 'issues'
&& github.event.action == 'unlabeled'
&& github.event.label.name == 'sprint'
)
)
runs-on: ubuntu-latest
steps:
# (helper) access private GitHub Action
- uses: actions/checkout@v2
# (helper) detect if attached to triaging board
- id: on_triaging
uses: conda/actions/[email protected]
with:
org: conda
project: ${{ env.TRIAGING_ID }}
issue: ${{ github.event.issue.id }}
github_token: ${{ secrets.PROJECT_TOKEN }}
# (helper) detect if attached to sprint board
- id: on_sprint
uses: conda/actions/[email protected]
with:
org: conda
project: ${{ env.SPRINT_ID }}
issue: ${{ github.event.issue.id }}
github_token: ${{ secrets.PROJECT_TOKEN }}
# (fail-safe) remove from Triaging board
- uses: alex-page/[email protected]
with:
action: delete # if present
project: Triaging
column: Ready # unused
repo-token: ${{ secrets.PROJECT_TOKEN }}
# add [backlog] label
- uses: actions-ecosystem/[email protected]
with:
labels: ${{ env.BACKLOG_LBL }}
number: ${{ github.event.issue.number }}
github_token: ${{ secrets.PROJECT_TOKEN }}
# add to Backlog board (from Triaging board)
- uses: alex-page/[email protected]
if: >-
fromJSON(steps.on_triaging.outputs.contains)
&& !contains(github.event.issue.labels.*.name, 'sprint')
&& !fromJSON(steps.on_sprint.outputs.contains)
with:
action: add # if not present
project: Backlog
column: Unplanned
repo-token: ${{ secrets.PROJECT_TOKEN }}
# add to Backlog board (from Sprint board)
- uses: alex-page/[email protected]
if: >-
!fromJSON(steps.on_triaging.outputs.contains)
|| contains(github.event.issue.labels.*.name, 'sprint')
|| fromJSON(steps.on_sprint.outputs.contains)
with:
action: add # if not present
project: Backlog
column: Do Next
repo-token: ${{ secrets.PROJECT_TOKEN }}
# remove [sprint] label
- uses: actions-ecosystem/[email protected]
with:
labels: ${{ env.SPRINT_LBL }}
number: ${{ github.event.issue.number }}
github_token: ${{ secrets.PROJECT_TOKEN }}
# remove from Sprint board
- uses: alex-page/[email protected]
with:
action: delete # if present
project: Sprint
column: To Do # unused
repo-token: ${{ secrets.PROJECT_TOKEN }}
# new -> Sprint[To Do]
# Backlog[Do Next] -> Sprint[To Do]
to_sprint:
# if new issue with [sprint]
# if unlabeled [backlog]
# if removed from Backlog board
# if labeled [sprint]
# if added to Sprint board
if: >-
!github.event.repository.fork
&& github.event.sender.login != 'conda-bot'
&& github.event.issue.state == 'open'
&& (
(
github.event_name == 'issues'
&& github.event.action == 'opened'
&& contains(github.event.issue.labels.*.name, 'sprint')
)
|| (
github.event_name == 'issues'
&& github.event.action == 'unlabeled'
&& github.event.label.name == 'backlog'
)
|| (
github.event_name == 'issues'
&& github.event.action == 'labeled'
&& github.event.label.name == 'sprint'
)
)
runs-on: ubuntu-latest
steps:
# (fail-safe) remove from Triaging board
- uses: alex-page/[email protected]
with:
action: delete # if present
project: Triaging
column: Ready # unused
repo-token: ${{ secrets.PROJECT_TOKEN }}
# remove [backlog] label
- uses: actions-ecosystem/[email protected]
with:
labels: ${{ env.BACKLOG_LBL }}
number: ${{ github.event.issue.number }}
github_token: ${{ secrets.PROJECT_TOKEN }}
# remove from Backlog board
- uses: alex-page/[email protected]
with:
action: delete # if present
project: Backlog
column: Do Next # unused
repo-token: ${{ secrets.PROJECT_TOKEN }}
# add [sprint] label
- uses: actions-ecosystem/[email protected]
with:
labels: ${{ env.SPRINT_LBL }}
number: ${{ github.event.issue.number }}
github_token: ${{ secrets.PROJECT_TOKEN }}
# add to Sprint board
- uses: alex-page/[email protected]
with:
action: add # if not present
project: Sprint
column: To Do
repo-token: ${{ secrets.PROJECT_TOKEN }}