From 02788b25962ebd731b4d27d468487ae34629083b Mon Sep 17 00:00:00 2001 From: Gustavo dos Santos Nascimento <74427958+GustavoSantoz@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:22:11 +0000 Subject: [PATCH] Auto assign --- .github/workflows/auto_assign.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/auto_assign.yml diff --git a/.github/workflows/auto_assign.yml b/.github/workflows/auto_assign.yml new file mode 100644 index 0000000..c37dea3 --- /dev/null +++ b/.github/workflows/auto_assign.yml @@ -0,0 +1,22 @@ +name: Auto Assign Issue + +on: + issues: + types: + - opened + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - name: Assign Issue Creator + run: | + ISSUE_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH") + CREATOR=$(jq --raw-output .issue.user.login "$GITHUB_EVENT_PATH") + + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${ISSUE_NUMBER}/assignees \ + --data-raw "{\"assignees\":[\"${CREATOR}\"]}" +