-
Notifications
You must be signed in to change notification settings - Fork 194
51 lines (51 loc) · 1.67 KB
/
addToAPMProject.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
name: Add to APM Project
on:
issues:
types:
- opened
jobs:
add_to_project:
runs-on: ubuntu-latest
name: Assign issues to APM Project for the Server Team
steps:
- uses: octokit/[email protected]
id: add_to_project
with:
query: |
mutation add_to_project($projectid:ID!,$contentid:ID!) {
addProjectV2ItemById(input:{projectId:$projectid contentId:$contentid}) {
item {
... on ProjectV2Item {
id
}
}
}
}
projectid: ${{ env.PROJECT_ID }}
contentid: ${{ github.event.issue.node_id }}
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
- uses: octokit/[email protected]
id: label_team
with:
query: |
mutation label_team($projectid:ID!,$itemid:ID!,$fieldid:ID!,$value:String!) {
updateProjectV2ItemFieldValue(input: { projectId:$projectid itemId:$itemid fieldId:$fieldid value:{singleSelectOptionId: $value} }) {
projectV2Item {
id
content {
... on Issue {
number
}
}
}
}
}
projectid: ${{ env.PROJECT_ID }}
itemid: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectV2ItemById.item.id }}
fieldid: "PVTSSF_lADOAGc3Zs0VSs2scg"
value: "6c538d8a"
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}