-
Notifications
You must be signed in to change notification settings - Fork 26
65 lines (63 loc) · 2.04 KB
/
add-to-apm-project.yaml
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
name: Add to Project
on:
issues:
types:
- opened
permissions:
contents: read
jobs:
add_to_project:
runs-on: ubuntu-latest
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"organization_projects": "write",
"issues": "read"
}
- 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: ${{ steps.get_token.outputs.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: ${{ steps.get_token.outputs.token }}