Repository navigation
74 lines (71 loc) · 2.88 KB
/
Copy pathagents.yml
File metadata and controls
74 lines (71 loc) · 2.88 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
# Written by .agents/setup.sh, which rewrites it on every skills pull.
# Change the shared workflows in cinchapi/cinchapi-agent-skills instead. Keep
# the name, because the CodeBuild runners start only for a workflow whose name
# begins with "Agent ".
name: Agent skills
on:
pull_request:
types: [opened, reopened, ready_for_review, labeled, synchronize]
pull_request_review:
types: [submitted]
issues:
types: [labeled]
issue_comment:
types: [created]
workflow_dispatch:
inputs:
skill:
description: Skill to run
type: choice
options:
- review-pipeline
- code-review
- code-comment-cleanup
- test-cleanup
- fix
- fix-conflicts
- work-on
- implement
number:
description: Pull request or issue number
type: number
required: true
args:
description: Extra instructions for the skill
type: string
required: false
permissions: {}
jobs:
agents:
# New commits on a pull request marked pipeline:done reach the router whoever
# pushed them, so it takes the label off. Dependabot's do not, because GitHub
# gives Dependabot's runs no Actions secrets, so the router could not act.
if: >-
(github.event_name == 'pull_request' && github.event.action == 'synchronize' &&
github.actor != 'dependabot[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'pipeline:done')) ||
(github.event.sender.type != 'Bot' &&
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
((github.event.action == 'labeled' &&
startsWith(github.event.label.name, 'agent:')) ||
(github.event.action != 'labeled' && !github.event.pull_request.draft))) ||
(github.event_name == 'pull_request_review' &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.review.state == 'changes_requested' ||
github.event.review.user.login == github.event.pull_request.user.login)) ||
(github.event_name == 'issues' &&
startsWith(github.event.label.name, 'agent:')) ||
(github.event_name == 'issue_comment' &&
(startsWith(github.event.comment.body, '/agent') ||
startsWith(github.event.comment.body, '/approve')))))
concurrency:
group: agents-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.number }}
queue: max
uses: cinchapi/cinchapi-agent-skills/.github/workflows/router.yml@31f89b30ce3f75f4b381156bf6ee1ce9752de45a
permissions:
contents: read
id-token: write
secrets: inherit