You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users should be able to comment "take" on an issue to be auto-assigned the issue.
This creates a good experience for OSS users. They can grab an issue and it will make sure nobody else is working on it.
// .github/workflows/auto-assign-issues.yml# This workflow has been inspired by https://github.com/MrPowers/quinn/blob/main/.github/workflows/assign-on-comment.ymlname: Auto Assign Issues On Commenton:
issue_comment:
types: [created]permissions:
issues: writejobs:
auto-assign:
runs-on: ubuntu-latestif: (!github.event.issue.pull_request) && github.event.comment.body == 'take'concurrency:
# Only run one a time per usergroup: ${{ github.actor }}-auto-assign-issuesteps:
- name: Check if issue can be assignedid: check-assigneerun: | # Check if the user is already assigned to the issue 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 commenterif: 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 -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 }}/assigneesenv:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log failure to assignif: env.HTTP_CODE != '204'run: | # Log the failure to assign the issue echo "Issue #${{ github.event.issue.number }} cannot be assigned to @${{ github.event.comment.user.login }}. HTTP response code: ${{ env.HTTP_CODE }}"
The text was updated successfully, but these errors were encountered:
JuanPabloDiaz
changed the title
[Feature] Auto Assign Issues On Comment
[Feature] Create GitHub workflow to assign issues to users on comment 'take'
Sep 7, 2024
Description
Users should be able to comment "take" on an issue to be auto-assigned the issue.
This creates a good experience for OSS users. They can grab an issue and it will make sure nobody else is working on it.
The text was updated successfully, but these errors were encountered: