-
Notifications
You must be signed in to change notification settings - Fork 255
70 lines (64 loc) · 2.62 KB
/
Copy pathtend-review.yaml
File metadata and controls
70 lines (64 loc) · 2.62 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
# Generated by tend. Regenerate with: uvx tend init
name: tend-review
on:
pull_request_target:
types: [opened, synchronize, ready_for_review, reopened]
pull_request_review:
types: [submitted]
jobs:
review:
if: |
(github.event_name == 'pull_request_target' &&
github.event.pull_request.draft == false) ||
(github.event_name == 'pull_request_review' &&
github.event.pull_request.user.login == 'prql-bot' &&
github.event.review.user.login != 'prql-bot' &&
(github.event.review.state != 'approved' || github.event.review.body))
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-24.04
timeout-minutes: 60
permissions:
contents: write
pull-requests: write
id-token: write
actions: read
issues: write
steps:
- name: Checkout (initial review)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v6
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }}
- name: Checkout (review response)
if: github.event_name == 'pull_request_review'
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }}
- name: Check out PR branch (review response)
if: github.event_name == 'pull_request_review'
run: gh pr checkout "$PR_NUMBER"
env:
GH_TOKEN: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- uses: ./.github/actions/tend-setup
- uses: max-sixty/tend@v1
with:
github_token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }}
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
bot_name: prql-bot
use_sticky_comment: ${{ github.event_name == 'pull_request_target' }}
prompt: >-
${{ github.event_name == 'pull_request_target'
&& format('/tend:tend-review {0}', github.event.pull_request.number)
|| format(
'A review was submitted on your PR #{0} ({1}). Read the review and full PR context (description, diff, comments, CI status), then respond appropriately. If changes were requested, make them, commit, and push. If questions were asked, answer them.',
github.event.pull_request.number,
github.event.review.html_url
) }}