Skip to content

Commit b729c6d

Browse files
authored
Add issue automation (#1184)
1 parent 56c299c commit b729c6d

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Label new issues with needs-team"
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
add-needs-triage-label:
9+
name: Add `needs-team` label
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Add the needs-team label
13+
uses: actions-ecosystem/action-add-labels@v1
14+
with:
15+
labels: |
16+
needs-team
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/add-to-board.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Triage & route issues
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
permissions:
8+
issues: write
9+
contents: read
10+
11+
jobs:
12+
route:
13+
runs-on: ubuntu-latest
14+
if: >
15+
contains(
16+
[
17+
'team:Obs',
18+
'team:Security',
19+
'team:Platform',
20+
'team:DocsEng',
21+
'team:Projects'
22+
],
23+
github.event.label.name
24+
)
25+
env:
26+
PROJECT_ID_MAP: |
27+
{
28+
"team:Obs": "649",
29+
"team:Security": "1034",
30+
"team:Platform": "1232",
31+
"team:DocsEng": "1625",
32+
"team:Projects": "1415"
33+
}
34+
steps:
35+
- name: Remove needs-team label
36+
uses: actions-ecosystem/action-remove-labels@v1
37+
with:
38+
labels: needs-team
39+
40+
- name: Add issue to the right project
41+
uses: actions/add-to-project@v1
42+
with:
43+
project-url: https://github.com/orgs/elastic/projects/${{ fromJson(env.PROJECT_ID_MAP)[github.event.label.name] }}
44+
github-token: ${{ secrets.ADD_TO_BOARD_TOKEN }}
45+
labeled: ${{ github.event.label.name }}
46+
label-operator: OR

0 commit comments

Comments
 (0)