From 0eaa263def6d50618aa8adaba0763faeef8717f0 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 22 Apr 2024 07:29:02 +0000 Subject: [PATCH 1/3] :sparkles: add noneflow reaction --- .github/workflows/noneflow.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/noneflow.yml b/.github/workflows/noneflow.yml index f73bb5dda056..66a250eff4a2 100644 --- a/.github/workflows/noneflow.yml +++ b/.github/workflows/noneflow.yml @@ -15,6 +15,39 @@ concurrency: cancel-in-progress: false jobs: + reaction: + runs-on: ubuntu-latest + name: reaction + if: | + ( + github.event_name == 'issue_comment' && + github.event.action == 'created' + ) || + ( + github.event_name == 'issue' && + github.event.action == 'opened' + ) + steps: + - name: Generate token + id: generate-token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_KEY }} + + - name: Reaction on issue + if: github.event_name == 'issue' + run: | + gh api --method POST /repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/reactions -f "content=rocket" + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + + - name: Reaction on issue comment + if: github.event_name == 'issue_comment' + run: | + gh api --method POST /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions -f "content=rocket" + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} plugin_test: runs-on: ubuntu-latest name: nonebot2 plugin test From 8999cc3636526e5b7892eb2410435d5c649b39f2 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 22 Apr 2024 07:39:36 +0000 Subject: [PATCH 2/3] :bug: fix typo --- .github/workflows/noneflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/noneflow.yml b/.github/workflows/noneflow.yml index 66a250eff4a2..7e8f1c2889bb 100644 --- a/.github/workflows/noneflow.yml +++ b/.github/workflows/noneflow.yml @@ -24,7 +24,7 @@ jobs: github.event.action == 'created' ) || ( - github.event_name == 'issue' && + github.event_name == 'issues' && github.event.action == 'opened' ) steps: From 9a06d662a099870e741a5ca0fd3e9f5dce08e76c Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Mon, 22 Apr 2024 07:40:18 +0000 Subject: [PATCH 3/3] :bug: fix typo --- .github/workflows/noneflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/noneflow.yml b/.github/workflows/noneflow.yml index 7e8f1c2889bb..ec114d30030f 100644 --- a/.github/workflows/noneflow.yml +++ b/.github/workflows/noneflow.yml @@ -36,7 +36,7 @@ jobs: private_key: ${{ secrets.APP_KEY }} - name: Reaction on issue - if: github.event_name == 'issue' + if: github.event_name == 'issues' run: | gh api --method POST /repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/reactions -f "content=rocket" env: