-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.yaml
More file actions
76 lines (67 loc) · 2.72 KB
/
agent.yaml
File metadata and controls
76 lines (67 loc) · 2.72 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
name: AI Agent
"on":
workflow_dispatch:
inputs:
prompt:
description: Custom prompt to run
required: false
issue_number:
description: Issue/PR number to comment on
required: false
issue_comment:
types: [created]
pull_request:
types: [review_requested]
pull_request_review:
types: [submitted]
pull_request_review_comment:
types: [created]
jobs:
agent:
# yamllint disable rule:line-length
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, format('@{0}', vars.BOT_NAME || 'ai-agent')) &&
github.event.comment.user.login != (vars.BOT_LOGIN || 'github-actions[bot]') &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request' &&
github.event.requested_reviewer.login == (vars.BOT_LOGIN || 'github-actions[bot]')) ||
(github.event_name == 'pull_request_review' &&
github.event.review.user.login != (vars.BOT_LOGIN || 'github-actions[bot]') &&
contains(github.event.review.body, format('@{0}', vars.BOT_NAME || 'ai-agent'))) ||
(github.event_name == 'pull_request_review_comment' &&
contains(github.event.comment.body, format('@{0}', vars.BOT_NAME || 'ai-agent')) &&
github.event.comment.user.login != (vars.BOT_LOGIN || 'github-actions[bot]') &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association))
# yamllint enable rule:line-length
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
# --- GitHub App Token (uncomment for production use) ---
# - name: Generate App Token
# id: app-token
# uses: actions/create-github-app-token@v1
# with:
# app-id: ${{ vars.APP_ID }}
# private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v6
with:
# github.head_ref: PR events (pull_request, pull_request_target)
# github.event.pull_request.head.ref: PR review/comment events
# github.ref: fallback for other events
# yamllint disable-line rule:line-length
ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }}
fetch-depth: 0
# token: ${{ steps.app-token.outputs.token }}
- name: Run Agent
uses: dobbyphus/action@main
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
bot_name: ${{ vars.BOT_NAME || 'ai-agent' }}
# github_token: ${{ steps.app-token.outputs.token }}