forked from elastic/ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.72 KB
/
add-to-ecs-project.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
name: Add to ECS project board
on:
issues:
types:
- opened
- reopened
env:
PROJECT_ID: PN_kwDOAGc3Zs4ABESq
STATUS_FIELD_ID: MDE2OlByb2plY3ROZXh0RmllbGQyNjE4MDM4
TRIAGE_VALUE: f75ad846
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }}
jobs:
issue_opened_or_reopened:
runs-on: ubuntu-latest
if: github.event_name == 'issues' && (github.event.action == 'opened' || github.event.action == 'reopened')
steps:
- name: Add issue to project
uses: octokit/[email protected]
id: add_to_project
with:
headers: '{"GraphQL-Features": "projects_next_graphql"}'
query: |
mutation add_to_project($projectid:ID!,$contentid:ID!) {
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
projectNextItem {
id
}
}
}
projectid: ${{ env.PROJECT_ID }}
contentid: ${{ github.event.issue.node_id }}
- name: Set status to 'Triage' on board
uses: octokit/[email protected]
id: set_status
with:
headers: '{"GraphQL-Features": "projects_next_graphql"}'
query: |
mutation label_team($projectid:ID!,$itemid:ID!,$fieldid:ID!,$value:String!) {
updateProjectNextItemField(input: { projectId:$projectid itemId:$itemid fieldId:$fieldid value:$value }) {
projectNextItem {
id
}
}
}
projectid: ${{ env.PROJECT_ID }}
itemid: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectNextItem.projectNextItem.id }}
fieldid: ${{ env.STATUS_FIELD_ID }}
value: ${{ env.TRIAGE_VALUE }}