Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Error occurs when processing my text-to-CAD request #16

Error occurs when processing my text-to-CAD request

Error occurs when processing my text-to-CAD request #16

Workflow file for this run

name: Auto Assign Users
on:
issues:
types: [opened]
workflow_dispatch:
permissions:
issues: write # Required to assign users to the issue
jobs:
auto-assign-team:
runs-on: ubuntu-latest
steps:
- name: Assign specified users to the issue
run: |
users=("jgomez720" "PapalapticAfterblast")
ISSUE_NUMBER=${{ github.event.issue.number }} # Get issue number from the input
echo "Repository: ${{ github.repository }}"
echo "Issue Number: ${{ github.event.issue.number }}"
# 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\": $assignees_json}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/assignees")
if [ "$response" -eq 201 ]; then
echo "Successfully assigned users to issue #$ISSUE_NUMBER."
else
echo "Error: Failed to assign users. HTTP response code: $response"
fi