From 579be98bbce8c6ffd7f8f6be2dde5de4ee06ab0f Mon Sep 17 00:00:00 2001 From: Rachit Mehta Date: Thu, 12 Feb 2026 10:04:45 -0500 Subject: [PATCH] auto run review workflow on maintainer PR --- .github/workflows/auto-strands-review.yml | 49 +++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/auto-strands-review.yml diff --git a/.github/workflows/auto-strands-review.yml b/.github/workflows/auto-strands-review.yml new file mode 100644 index 000000000..68190f7a0 --- /dev/null +++ b/.github/workflows/auto-strands-review.yml @@ -0,0 +1,49 @@ +name: Auto Strands Review + +on: + pull_request_target: + branches: [main] + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + authorization-check: + name: Check access + permissions: read-all + runs-on: ubuntu-latest + outputs: + approval-env: ${{ steps.auth.outputs.result }} + steps: + - name: Check Authorization + id: auth + uses: strands-agents/devtools/authorization-check@main + with: + skip-check: false + username: ${{ github.event.pull_request.user.login || 'invalid' }} + allowed-roles: 'triage,write,admin' + + trigger-review: + name: Trigger Strands Review + needs: authorization-check + environment: ${{ needs.authorization-check.outputs.approval-env }} + permissions: + actions: write + contents: read + runs-on: ubuntu-latest + steps: + - name: Trigger Strands Command Workflow + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'strands-command.yml', + ref: 'main', + inputs: { + issue_id: String(context.payload.pull_request.number), + command: 'review', + session_id: '' + } + }); + console.log(`Triggered /strands review for PR #${context.payload.pull_request.number}`);