Skip to content

Commit 17ddca8

Browse files
Adding Project Number
1 parent 73b9ce1 commit 17ddca8

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

.github/workflows/project-automation.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- run: |
14-
gh api graphql -f query='mutation($project:ID!, $issue:ID!) { addProjectNextItem(input: {projectId: $project, contentId: $issue}) { projectNextItem { id } } }' -f project=${{ secrets.PROJECT_ID }} -f issue=${{ github.event.issue.node_id }}
14+
gh api graphql -f query='
15+
query($org: String!, $number: Int!) {
16+
organization(login: $org){
17+
projectNext(number: $number) {
18+
id
19+
fields(first:20) {
20+
nodes {
21+
id
22+
name
23+
settings
24+
}
25+
}
26+
}
27+
}
28+
}' -f org=${{ secrets.PROJECT_ORGANIZATION }} -F number=${{ secrets.PROJECT_NUMBER }} > project_data.json
29+
30+
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
31+
32+
gh api graphql -f query='
33+
mutation($project:ID!, $issue:ID!) {
34+
addProjectNextItem(input: {projectId: $project, contentId: $issue}) {
35+
projectNextItem { id }
36+
}
37+
}' -f project=$PROJECT_ID -f issue=${{ github.event.issue.node_id }}
1538
env:
1639
GITHUB_TOKEN: ${{ secrets.PROJECT_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)