Skip to content

Commit

Permalink
Changed graphql to one line in step 4 of update-issue-status.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Belle P authored and Belle P committed Nov 19, 2024
1 parent c753be0 commit 43530e8
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/update-issue-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,14 @@ jobs:
- name: Update Issue Status to 'Done'
run: |
issue_id=${{ env.issue_id }}
project_id="1314" # Dynamic project ID, if necessary
status_field_id="${{ env.status_field_id }}" # Retrieved dynamically
done_option_id="${{ env.done_option_id }}" # Retrieved dynamically
project_id="1314"
status_field_id="${{ env.status_field_id }}"
done_option_id="${{ env.done_option_id }}"
echo "Updating issue #$issue_number status to 'Done'"
# GraphQL Mutation to update status
query="mutation {
updateProjectV2ItemFieldValue(input: {
projectId: \"$project_id\",
itemId: \"$issue_id\",
fieldId: \"$status_field_id\",
value: \"$done_option_id\"
}) {
projectV2Item {
id
content {
... on Issue {
id
number
title
}
}
}
}
}"
query="{\"query\": \"mutation { updateProjectV2ItemFieldValue(input: { projectId: \\\"$project_id\\\", itemId: \\\"$issue_id\\\", fieldId: \\\"$status_field_id\\\", value: \\\"$done_option_id\\\" }) { projectV2Item { id content { ... on Issue { id number title } } } } }\"}"
response=$(curl -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-X POST \
Expand Down

0 comments on commit 43530e8

Please sign in to comment.