Skip to content

Commit

Permalink
Create assign-issue.yml (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
saudsami authored Nov 1, 2024
1 parent 1a2eb70 commit 8b9fcc3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/assign-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Assign New Issues"

on:
issues:
types: [opened]

jobs:
assign_issue:
runs-on: ubuntu-latest
steps:
- name: Check if issue has assignees
id: check
run: |
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }} \
| jq '.assignees | length' > assignee_count.txt
- name: Assign issue if no assignees
if: ${{ steps.check.outputs.assignee_count == 0 }}
uses: actions-ecosystem/action-add-issue-assignees@v1
with:
assignees: "saudsami"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8b9fcc3

Please sign in to comment.