From 8b9fcc3c455411b6a80df416bf13d91ac99120e2 Mon Sep 17 00:00:00 2001 From: Saud <65331551+saudsami@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:18:06 +0500 Subject: [PATCH] Create assign-issue.yml (#1595) --- .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 }}