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

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomez720 committed Sep 13, 2024
1 parent 4bc4cf1 commit d5b398c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/assign-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,35 @@ name: Auto Assign Team to Issues
on:
issues:
types: [opened]
workflow_dispatch:

jobs:
auto-assign-team:
runs-on: ubuntu-latest


steps:
- name: Get team members
- name: Get team members using GitHub API
id: team-members
run: |
response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/orgs/KittyCAD/teams/support/members")
response=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/KittyCAD/teams/support/members)
echo "API Response:"
echo "$response" | jq '.' # Debug to see the structure
# Extract the member logins
echo "$response" | jq -r '.[].login' > team_members.txt
- name: Assign team members to the issue
run: |
while IFS= read -r member; do
curl -s -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{\"assignees\": [\"$member\"]}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}"
done < team_members.txt
done < team_members.txt

0 comments on commit d5b398c

Please sign in to comment.