From 8f10d1bbf4dc7d683f1a19528e30fff2333d56f0 Mon Sep 17 00:00:00 2001 From: Artlfmj <73163159+Artlfmj@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:55:49 +0200 Subject: [PATCH] chore(workflows): adds assign bot --- .github/workflows/assignment.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/assignment.yml diff --git a/.github/workflows/assignment.yml b/.github/workflows/assignment.yml new file mode 100644 index 0000000..ff566dc --- /dev/null +++ b/.github/workflows/assignment.yml @@ -0,0 +1,22 @@ +name: Assign Bot + +on: + issue_comment: + types: + - created + +jobs: + assign: + runs-on: ubuntu-latest + + steps: + - name: Check for Mention + if: contains(github.event.comment.body, '@Artlfmj assign me') + run: | + commenter=$(jq -r '.comment.user.login' "$GITHUB_EVENT_PATH") + commenter=$(echo "$commenter" | tr -d '[:space:]') + issue_number=$(jq -r '.issue.number' "$GITHUB_EVENT_PATH") + echo "Assigning @$commenter to issue #$issue_number" + gh issue assign "$issue_number" --assignee "$commenter" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}