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}\"]}" +