From a12363afe4414c16a3a0263607c2878cb937e669 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Wed, 14 Aug 2024 18:30:44 +0530 Subject: [PATCH] ci: add assignee to a PR (#563) Co-authored-by: Saksham Sharma --- .github/workflows/pr-title-spell-check.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/pr-title-spell-check.yml b/.github/workflows/pr-title-spell-check.yml index 424b18127..f62979b4f 100644 --- a/.github/workflows/pr-title-spell-check.yml +++ b/.github/workflows/pr-title-spell-check.yml @@ -26,3 +26,15 @@ jobs: uses: crate-ci/typos@master with: files: ./pr_title.txt + + - name: Assign to author + run: | + PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/assignees \ + -d '{"assignees":["${{ github.event.pull_request.user.login }}"]}' \ No newline at end of file