forked from strands-agents/harness-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.77 KB
/
Copy pathauto-strands-review.yml
File metadata and controls
55 lines (52 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Auto Strands Review
on:
pull_request_target:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
jobs:
authorization-check:
# Authors who opt out of auto-review. They can still trigger it manually
# by commenting ``/strands review`` on the PR.
if: ${{ !contains(fromJSON('["chaynabors"]'), github.event.pull_request.user.login) }}
name: Check access
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
approval-env: ${{ steps.auth.outputs.approval-env }}
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,maintain,admin'
trigger-review:
name: Trigger Strands Review
needs: authorization-check
environment:
name: ${{ needs.authorization-check.outputs.approval-env }}
deployment: false
permissions:
actions: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Trigger Strands Command Workflow
uses: actions/github-script@v9
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}`);