From ac2e03b506cc86f234703eedae583db6fddef01f Mon Sep 17 00:00:00 2001 From: uy_sun Date: Mon, 22 Apr 2024 17:06:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20reaction=20?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/noneflow.yml | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/examples/noneflow.yml b/examples/noneflow.yml index 795d70cd..ec114d30 100644 --- a/examples/noneflow.yml +++ b/examples/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 == 'issues' && + 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 == 'issues' + 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 @@ -47,7 +80,7 @@ jobs: run: pipx install poetry - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" @@ -73,7 +106,7 @@ jobs: token: ${{ steps.generate-token.outputs.token }} - name: Cache pre-commit hooks - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .cache/.pre-commit key: noneflow-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}