Skip to content

PostHog Watcher worker #1572

PostHog Watcher worker

PostHog Watcher worker #1572

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 }}