File tree Expand file tree Collapse file tree 1 file changed +5
-37
lines changed Expand file tree Collapse file tree 1 file changed +5
-37
lines changed Original file line number Diff line number Diff line change 11name : Auto Assign Issues to Project
2- # From: https://www.cloudwithchris.com/blog/automate-adding-gh-issues-projects-beta/
32on :
43 issues :
54 types : [opened]
6- env :
7- GITHUB_TOKEN : ${{ secrets.PROJECT_GITHUB_TOKEN }}
85
96jobs :
107 assign_issue_to_project :
118 runs-on : ubuntu-latest
129 steps :
13- - name : Get project data
14- env :
15- ORGANIZATION : scalableminds
16- PROJECT_NUMBER : 6
17- run : |
18- gh api graphql -f query='
19- query($org: String!, $number: Int!) {
20- organization(login: $org){
21- projectNext(number: $number) {
22- id
23- fields(first:20) {
24- nodes {
25- id
26- name
27- settings
28- }
29- }
30- }
31- }
32- }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
10+ - name : Add to GitHub projects
11+ 12+ with :
13+ project-url : https://github.com/orgs/scalableminds/projects/6
14+ github-token : ${{ secrets.PROJECT_GITHUB_TOKEN }}
3315
34- echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
35-
36- - name : Add issue to project
37- env :
38- ISSUE_ID : ${{ github.event.issue.node_id }}
39- run : |
40- item_id="$( gh api graphql -f query='
41- mutation($project:ID!, $issue:ID!) {
42- addProjectNextItem(input: {projectId: $project, contentId: $issue}) {
43- projectNextItem {
44- id
45- }
46- }
47- }' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
You can’t perform that action at this time.
0 commit comments