From 1849458b719a03f70be40c2ad10aff9202bed47e Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Sat, 26 Jul 2025 05:40:39 +0800 Subject: [PATCH] BLOG-79 build: auto comment `/improve` command --- .gitea/workflows/pr_agent.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .gitea/workflows/pr_agent.yaml diff --git a/.gitea/workflows/pr_agent.yaml b/.gitea/workflows/pr_agent.yaml new file mode 100644 index 0000000..196764a --- /dev/null +++ b/.gitea/workflows/pr_agent.yaml @@ -0,0 +1,20 @@ +name: Auto Comment On PR + +on: + pull_request: + types: + - opened + - reopened + +jobs: + add_improve_comment: + runs-on: ubuntu-latest + steps: + - name: Add '/improve' comment to PR + run: | + echo "Target URL: ${{ vars.GIT_PROVIDER_URL }}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.ref_name }}/comments" + curl --fail -X POST \ + -H "Authorization: token ${{ secrets.BOT_PAT }}" \ + -H "Content-Type: application/json" \ + -d '{"body": "/improve"}' \ + "${{ vars.GIT_PROVIDER_URL }}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.ref_name }}/comments"