From f400bcf486a876052c4a5c6b1578e709085e89f9 Mon Sep 17 00:00:00 2001 From: SquidSpirit Date: Sat, 26 Jul 2025 07:01:50 +0800 Subject: [PATCH] BLOG-79 AI review bot (#83) ### Description - Use Qudo Merge as self-hosted PR agent - Add a workflow that auto comment /improve command to start the agent ### Package Changes _No response_ ### Screenshots _No response_ ### Reference Resolves #79 ### Checklist - [x] A milestone is set - [x] The related issuse has been linked to this branch Reviewed-on: https://git.squidspirit.com/squid/blog/pulls/83 Co-authored-by: SquidSpirit Co-committed-by: SquidSpirit --- .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"