diff --git a/.github/workflows/assign-issue.yml b/.github/workflows/assign-issue.yml index 14f9cb4..866c78c 100644 --- a/.github/workflows/assign-issue.yml +++ b/.github/workflows/assign-issue.yml @@ -17,12 +17,16 @@ jobs: run: | users=("jgomez720" "PapalapticAfterblast") ISSUE_NUMBER=30 # Get issue number from the input + + # Create a properly formatted JSON string for the assignees array + assignees_json=$(printf '%s\n' "${users[@]}" | jq -R . | jq -s .) + echo "Assigning users: $assignees_json" # Assign users to the issue using the correct endpoint response=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "Content-Type: application/json" \ - -d "{\"assignees\": [$(for user in "${users[@]}"; do echo "\"$user\","; done | sed 's/,$//')]}" \ + -d "{\"assignees\": $assignees_json}" \ "https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/assignees") if [ "$response" -eq 201 ]; then