PostHog Watcher worker #819
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup | |
| with: | |
| install: 'false' | |
| build: 'false' | |
| - name: Install ripgrep for watcher search tools | |
| run: sudo apt-get update && sudo apt-get install -y ripgrep | |
| - name: Drain watcher queue | |
| uses: PostHog/posthog-watcher-action@4eeb4867209b0f75a1bc8a1ee661f002502afe6b | |
| 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup | |
| with: | |
| install: 'false' | |
| build: 'false' | |
| - name: Install ripgrep for watcher search tools | |
| run: sudo apt-get update && sudo apt-get install -y ripgrep | |
| - name: Process watcher issue | |
| uses: PostHog/posthog-watcher-action@4eeb4867209b0f75a1bc8a1ee661f002502afe6b | |
| 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 }} |