-
Notifications
You must be signed in to change notification settings - Fork 36
56 lines (54 loc) · 1.73 KB
/
update-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
51
52
53
54
55
56
name: update-project
on:
issues:
types:
- labeled
jobs:
update-issue-column:
runs-on: ubuntu-latest
permissions:
repository-projects: write
steps:
- uses: actions/checkout@v4
- name: Get column ID
id: get-column
run: |
value=$(jq -r .labelToColumnId.\"${{ github.event.label.name }}\" update-project.json)
echo "id=$value" >>$GITHUB_OUTPUT
echo "Label: ${{ github.event.label.name }}"
echo "Column id: $value"
- name: Add issue to project
if: ${{ steps.get-column.outputs.id != 'null' }}
id: add-to-project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/pyOpenSci/projects/7
github-token: ${{ secrets.GHPROJECT_TOKEN }}
- name: Move issue to column
if: ${{ steps.get-column.outputs.id != 'null' }}
uses: octokit/[email protected]
with:
query: |
mutation($project: ID!, $item: ID!, $field: ID!, $column: String!) {
updateProjectV2ItemFieldValue(
input: {
projectId: $project
itemId: $item
fieldId: $field
value: {
singleSelectOptionId: $column
}
}
) {
projectV2Item {
id
}
}
}
variables: |
project: "PVT_kwDOAbmP7s4ASqjL"
item: ${{ steps.add-to-project.outputs.itemId }}
field: "PVTSSF_lADOAbmP7s4ASqjLzgL66FI"
column: ${{ steps.get-column.outputs.id }}
env:
GITHUB_TOKEN: ${{ secrets.GHPROJECT_TOKEN }}