From 382e615d5b318e5bad9a5d431ed91c03299e28f8 Mon Sep 17 00:00:00 2001 From: Nancy Huang <205217630+naanci@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:27:18 -0500 Subject: [PATCH 1/4] 801: testing --- .github/workflows/ai-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index 935595f24..cb5670ce1 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -13,7 +13,7 @@ permissions: pull-requests: write concurrency: - group: pr-ai-${{ github.event.number || github.event.issue.number }}-${{ github.event.comment.body || 'pr' }} + group: pr-ai-${{ github.event.number || github.event.issue.number || github.sha }}-${{ github.event.comment.body || 'pr' }} cancel-in-progress: true jobs: From 4a7464f914b5e682c44de658611fb42f48328840 Mon Sep 17 00:00:00 2001 From: Nancy <205217630+naanci@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:30:57 -0500 Subject: [PATCH 2/4] 801: ai suggestion Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/ai-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index cb5670ce1..24c9ef04c 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -13,7 +13,7 @@ permissions: pull-requests: write concurrency: - group: pr-ai-${{ github.event.number || github.event.issue.number || github.sha }}-${{ github.event.comment.body || 'pr' }} + group: pr-ai-${{ github.event.number || github.event.issue.number || github.head_ref || github.ref_name }}-${{ github.event.comment.body || 'pr' }} cancel-in-progress: true jobs: From f5823d62176b161d2ec7befbc4ae6284626d9843 Mon Sep 17 00:00:00 2001 From: Nancy Huang <205217630+naanci@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:55:14 -0500 Subject: [PATCH 3/4] 801: testestttest --- .github/workflows/ai-review.yml | 62 ++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index 24c9ef04c..2e3c69962 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -1,29 +1,38 @@ -name: AI Code Review -run-name: Running AI code review on ${{ github.actor }}'s branch +name: AI Command Handler +run-name: Triggering AI review commands on PR #${{ inputs.prId }} + +concurrency: + group: ai-command-${{ github.event.inputs.prId || github.event.pull_request.number }} + cancel-in-progress: true on: pull_request: types: [opened, reopened, ready_for_review, synchronize] - issue_comment: - types: [created] + workflow_dispatch: + inputs: + prId: + description: "PR to deploy" + required: false + repository: + description: "The repository from which the slash command was dispatched" + required: false + comment-id: + description: "The comment-id of the slash command" + required: false + author: + description: "The author that triggered this actions" + required: false permissions: - contents: write - issues: write + contents: read pull-requests: write -concurrency: - group: pr-ai-${{ github.event.number || github.event.issue.number || github.head_ref || github.ref_name }}-${{ github.event.comment.body || 'pr' }} - cancel-in-progress: true - jobs: getPRHead: name: Get PR head SHA runs-on: ubuntu-latest - if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && (github.event.comment.body == '/review' || github.event.comment.body == '/describe' || github.event.comment.body == '/improve')) outputs: sha: ${{ steps.pr-head.outputs.result }} - prId: ${{ github.event.number || github.event.issue.number }} steps: - name: Get PR head SHA id: pr-head @@ -31,16 +40,16 @@ jobs: with: result-encoding: string script: | - const prId = ${{ github.event.number || github.event.issue.number }}; + const prId = ${{ inputs.prId || github.event.pull_request.number }}; const { data: pr } = await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, pull_number: parseInt(prId, 10) }); return pr.head.sha; - - aiCodeReview: - name: Run AI Code Review on the PR + ` + triggerAiReview: + name: Trigger AI Review Commands runs-on: ubuntu-latest needs: getPRHead @@ -63,6 +72,27 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} UNLOAD_ENVIRONMENTS: ci + - name: Post /review command + uses: ./.github/composite/send-message + with: + prId: ${{ inputs.prId || github.event.pull_request.number }} + message: "/review" + token: ${{ env.GH_PAT }} + + - name: Post /describe command + uses: ./.github/composite/send-message + with: + prId: ${{ inputs.prId || github.event.pull_request.number }} + message: "/describe" + token: ${{ env.GH_PAT }} + + - name: Post /improve command + uses: ./.github/composite/send-message + with: + prId: ${{ inputs.prId || github.event.pull_request.number }} + message: "/improve" + token: ${{ env.GH_PAT }} + - name: Run composite workflow uses: ./.github/composite/notion-checks id: notion_check From 99fab0b4af6979217e853b725da2c110d147fa74 Mon Sep 17 00:00:00 2001 From: Nancy Huang <205217630+naanci@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:03:21 -0500 Subject: [PATCH 4/4] 801: fix --- .github/workflows/ai-review.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index 2e3c69962..2b4f14759 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -31,8 +31,10 @@ jobs: getPRHead: name: Get PR head SHA runs-on: ubuntu-latest + if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && (github.event.comment.body == '/review' || github.event.comment.body == '/describe' || github.event.comment.body == '/improve')) outputs: sha: ${{ steps.pr-head.outputs.result }} + prId: ${{ github.event.number || github.event.issue.number }} steps: - name: Get PR head SHA id: pr-head @@ -40,14 +42,13 @@ jobs: with: result-encoding: string script: | - const prId = ${{ inputs.prId || github.event.pull_request.number }}; + const prId = ${{ github.event.number || github.event.issue.number }}; const { data: pr } = await github.rest.pulls.get({ owner: context.repo.owner, repo: context.repo.repo, pull_number: parseInt(prId, 10) }); return pr.head.sha; - ` triggerAiReview: name: Trigger AI Review Commands runs-on: ubuntu-latest