From d5206271e9619b695d220756132efe72e49cc4c9 Mon Sep 17 00:00:00 2001 From: William Mwai Date: Mon, 11 May 2026 10:45:34 +0300 Subject: [PATCH] Add GitHub Actions workflow for PR comments This workflow automates commenting on pull requests to trigger bot reviews when a PR is opened or updated. --- .github/workflows/pr-comment.yml | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/pr-comment.yml diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml new file mode 100644 index 00000000..3582c951 --- /dev/null +++ b/.github/workflows/pr-comment.yml @@ -0,0 +1,53 @@ +name: Comment on PR + +on: + pull_request: + branches: + - main + types: [opened, synchronize] + +jobs: + trigger-bot-review: + name: Trigger Bot Review + runs-on: ubuntu-latest + timeout-minutes: 5 + env: + GITHUB_TOKEN: ${{ secrets.BOT_REVIEW_COMMENT_ACCESS_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - name: Add comment on PR creation to trigger bot review + if: github.event.action == 'opened' && github.base_ref == 'main' + uses: actions/github-script@v7 + continue-on-error: true + timeout-minutes: 5 + with: + github-token: ${{ env.GITHUB_TOKEN }} + script: | + const comments = ['/agentic_describe', '/agentic_review']; + for (const comment of comments) { + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + } + + - name: Add comment on PR update + if: github.event.action == 'synchronize' && github.base_ref == 'main' + uses: actions/github-script@v7 + continue-on-error: true + timeout-minutes: 5 + with: + github-token: ${{ env.GITHUB_TOKEN }} + script: | + const comments = ['/agentic_review']; + for (const comment of comments) { + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + }