-
Notifications
You must be signed in to change notification settings - Fork 331
107 lines (96 loc) · 3.83 KB
/
Copy pathposthog-watcher-worker.yml
File metadata and controls
107 lines (96 loc) · 3.83 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
name: PostHog Watcher worker
on:
workflow_dispatch:
inputs:
issue-number:
description: Issue or PR number to process immediately. Leave empty to drain the queue.
required: false
default: ''
mode:
description: Processing mode for issue-number.
required: false
default: auto
type: choice
options:
- auto
- triage
- investigate
- fix
schedule:
- cron: '*/15 * * * *'
concurrency:
group: posthog-watcher-${{ github.repository }}-${{ inputs['issue-number'] || 'queue' }}
cancel-in-progress: false
permissions:
contents: write
issues: write
pull-requests: write
actions: read
jobs:
drain-queue:
if: ${{ github.event_name != 'workflow_dispatch' || inputs['issue-number'] == '' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
install: 'false'
build: 'false'
- name: Install watcher search tools
run: |
sudo apt-get update
sudo apt-get install -y fd-find ripgrep
sudo ln -sf "$(command -v fdfind)" /usr/local/bin/fd
- name: Drain watcher queue
uses: PostHog/posthog-watcher-action@2a52bc42a5c60b415218da3d9705fd4c4fc0e76c
with:
openai-api-key: ${{ secrets.POSTHOG_WATCHER_OPENAI_API_KEY }}
mode: drain-queue
labels: '*'
allow-fix: 'true'
allow-close: 'true'
allow-security-ai: 'true'
max-repair-attempts: '3'
max-pi-calls: '16'
fix-pr-review-team: PostHog/team-client-libraries
approve-project-resources: 'true'
state-enabled: 'true'
pi-session-sharing: 'true'
pi-session-sharing-mode: gist
pi-session-gist-token: ${{ secrets.PI_SESSION_GIST_TOKEN }}
process-issue:
if: ${{ github.event_name == 'workflow_dispatch' && inputs['issue-number'] != '' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
install: 'false'
build: 'false'
- name: Install watcher search tools
run: |
sudo apt-get update
sudo apt-get install -y fd-find ripgrep
sudo ln -sf "$(command -v fdfind)" /usr/local/bin/fd
- name: Process watcher issue
uses: PostHog/posthog-watcher-action@2a52bc42a5c60b415218da3d9705fd4c4fc0e76c
with:
openai-api-key: ${{ secrets.POSTHOG_WATCHER_OPENAI_API_KEY }}
issue-number: ${{ inputs['issue-number'] }}
mode: ${{ inputs.mode }}
labels: '*'
allow-fix: 'true'
allow-close: 'true'
allow-security-ai: 'true'
max-repair-attempts: '3'
max-pi-calls: '16'
fix-pr-review-team: PostHog/team-client-libraries
approve-project-resources: 'true'
state-enabled: 'true'
pi-session-sharing: 'true'
pi-session-sharing-mode: gist
pi-session-gist-token: ${{ secrets.PI_SESSION_GIST_TOKEN }}