From 680ca29b64f6bc570503c52489d7809d49f75834 Mon Sep 17 00:00:00 2001 From: Saud <65331551+saudsami@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:17:21 +0500 Subject: [PATCH] Create assign-issue.yml --- .github/workflows/assign-issue.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/assign-issue.yml diff --git a/.github/workflows/assign-issue.yml b/.github/workflows/assign-issue.yml new file mode 100644 index 000000000..fc716476f --- /dev/null +++ b/.github/workflows/assign-issue.yml @@ -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 }}