Skip to content

Commit

Permalink
debug claim workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pitmonticone committed Oct 10, 2024
1 parent 69dc84e commit 5c24dd4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/01-claim-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,25 @@ jobs:
# Retrieve the project item (issue) and check its current status
ITEM_ID_QUERY=$(cat <<EOF
{
"query": "{ repository(owner: \\"${{ github.repository_owner }}\\", name: \\"${{ github.event.repository.name }}\\") { issue(number: ${{ github.event.issue.number }}) { id } } }"
"query": "{ repository(owner: \\"${{ github.repository_owner }}\\", name: \\"${{ github.event.repository.name }}\\") { issue(number: ${{ github.event.issue.number }}) { projectItems(first: 1) { nodes { id } } } } }"
}
EOF
)
echo "Sending query to get item ID: $ITEM_ID_QUERY"
echo "Sending query to get project item ID: $ITEM_ID_QUERY"
ITEM_ID_RESPONSE=$(curl -X POST -H "Authorization: Bearer ${{ secrets.PAT_TOKEN }}" \
-H "Content-Type: application/json" \
--data "$ITEM_ID_QUERY" https://api.github.com/graphql)
echo "Item ID Response: $ITEM_ID_RESPONSE"
ITEM_ID=$(echo "$ITEM_ID_RESPONSE" | jq -r '.data.repository.issue.id')
ITEM_ID=$(echo "$ITEM_ID_RESPONSE" | jq -r '.data.repository.issue.projectItems.nodes[0].id')
if [ -z "$ITEM_ID" ]; then
echo "Error: Could not retrieve the ITEM_ID for the issue"
exit 1
fi
# Correctly handle union types and query the field values
FIELD_QUERY=$(cat <<EOF
{
"query": "{ node(id: \\"$ITEM_ID\\") { ... on ProjectV2Item { fieldValues(first: 10) { nodes { ... on ProjectV2ItemFieldSingleSelectValue { field { ... on ProjectV2FieldCommon { name } } optionId } } } } } }"
Expand Down

0 comments on commit 5c24dd4

Please sign in to comment.