-
Notifications
You must be signed in to change notification settings - Fork 14.5k
152 lines (136 loc) · 5.07 KB
/
bonk.yml
File metadata and controls
152 lines (136 loc) · 5.07 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Bonk
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
pull_request:
types: [opened]
concurrency:
# intentionally hardcoded so that all Bonk workflows coexist peacefully
group: bonk-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}
cancel-in-progress: false
jobs:
check-codeowner:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
is-codeowner: ${{ steps.check.outputs.is-codeowner }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 1
- name: Check CODEOWNERS
id: check
uses: ./.github/actions/check-codeowner
with:
GH_ORG_TOKEN: ${{ secrets.GH_ORG_TOKEN }}
bonk:
needs: check-codeowner
if: |
needs.check-codeowner.outputs.is-codeowner == 'true' &&
github.event.sender.type != 'Bot' &&
contains(github.event.comment.body, '/bonk') &&
!contains(github.event.comment.body, '/bigbonk')
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 1
- name: Set up pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
with:
version: 11
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
id: setup-node
with:
node-version: 24.x
cache: pnpm
- name: Restore node_modules (cache hit)
id: node-modules-cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: node_modules
key: node-modules-${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('package.json') }}
- name: Install node_modules (cache miss)
run: pnpm install --frozen-lockfile
if: steps.node-modules-cache.outputs.cache-hit != 'true'
- name: Run Lil Bonk
uses: ask-bonk/ask-bonk/github@main
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_AI_GATEWAY_ACCOUNT_ID }}
CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }}
with:
model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.6"
agent: docs
mentions: "/bonk"
permissions: write
bonk-auto-review:
needs: check-codeowner
if: |
needs.check-codeowner.outputs.is-codeowner == 'true' &&
github.event_name == 'pull_request' &&
github.event.sender.type != 'Bot' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
contents: read
issues: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 1
- name: Set up pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
with:
version: 11
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
id: setup-node
with:
node-version: 24.x
cache: pnpm
- name: Restore node_modules (cache hit)
id: node-modules-cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: node_modules
key: node-modules-${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('package.json') }}
- name: Install node_modules (cache miss)
run: pnpm install --frozen-lockfile
if: steps.node-modules-cache.outputs.cache-hit != 'true'
- name: Run Lil Bonk (auto-review)
uses: ask-bonk/ask-bonk/github@main
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_AI_GATEWAY_ACCOUNT_ID }}
CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }}
with:
model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.6"
agent: docs
permissions: write
token_permissions: NO_PUSH
prompt: |
Review this pull request. Review the title, description, and diff.
Apply appropriate labels, summarize what the PR changes, and flag
any issues that need attention from a maintainer (e.g. missing
description, broken links, incorrect frontmatter, style guide
violations). You may suggest specific code changes as inline review
comments, but do not push commits or open new PRs.