Skip to content

Commit

Permalink
Merge pull request #5 from nijanthanvijayakumar/feature/auto-assign-i…
Browse files Browse the repository at this point in the history
…ssues

Rollback changes made on auto-assign workflow related to GITHUB_TOKEN
  • Loading branch information
nijanthanvijayakumar authored Jul 11, 2024
2 parents 87c64bc + 76b7f45 commit cb09c9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-assign-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
id: check-assignee
run: |
# Check if the user is already assigned to the issue
RESPONSE=$(curl -LI https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees/${{ github.event.comment.user.login }} -o /dev/null -w '%{http_code}' -s)
RESPONSE=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -LI https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees/${{ github.event.comment.user.login }} -o /dev/null -w '%{http_code}' -s)
echo "HTTP_CODE=$RESPONSE" >> $GITHUB_ENV
- name: Assign issue to commenter
if: env.HTTP_CODE == '204'
run: |
# Assign the issue to the user who commented 'take'
echo "Assigning issue #${{ github.event.issue.number }} to @${{ github.event.comment.user.login }}"
curl -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit cb09c9c

Please sign in to comment.