posthog/PostHog Watcher
Triage GitHub issues with pi and optionally open straightforward fix PRs
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 7, 2026
- License
- MIT
Pinned Snippet
uses: posthog/posthog-watcher-action@dd71af80d9ffc6957a1bac044f13abb889c83518 # v0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| posthog-api-key | PostHog OAuth access token (pha_...) used by pi against the PostHog LLM gateway. Personal API keys (phx_...) are rejected by the gateway. Required for posthog/* models except in enqueue mode. | no | "" |
| posthog-region | PostHog Cloud region (us, eu, or dev). Used with posthog/* models for the LLM gateway, and with fix-executor posthog-code to pick the PostHog Code tasks REST API host. | no | us |
| openai-api-key | OpenAI API key used by pi. Required for openai/* models except in enqueue mode. | no | "" |
| fix-executor | Fix execution engine. pi runs the guarded local repair loop; posthog-code delegates the whole fix to PostHog Code's cloud sandbox, which opens the PR itself. WARNING - posthog-code bypasses this action's fix guardrails (repair loop, reproduction checks, max-changed-files/max-diff-lines, independent review gate, GitHub-signed commits, validation-command, PR template). | no | pi |
| posthog-code-api-key | PostHog personal API key (phx_...) for the PostHog Code tasks REST API. Required when fix-executor is posthog-code. This is a different credential from posthog-api-key (the pha_ LLM gateway token). | no | "" |
| posthog-code-project-id | PostHog project id for the PostHog Code tasks REST API. Required when fix-executor is posthog-code. The API host comes from posthog-region and the cloud model from the model input (posthog/* ids map directly; other providers fall back to claude-opus-4-8). | no | "" |
| posthog-code-runtime-adapter | PostHog Code runtime adapter for delegated cloud runs. | no | claude |
| posthog-code-poll-interval-ms | Poll interval in milliseconds while waiting for a delegated PostHog Code run to finish. | no | 15000 |
| posthog-code-timeout-ms | Overall timeout in milliseconds for a delegated PostHog Code run before the action requests cancellation. | no | 1800000 |
| github-token | GitHub token for issue labels, comments, branches, and PRs | no | ${{ github.token }} |
| model | pi model identifier. openai/* models call OpenAI directly, posthog/* models route through the PostHog LLM gateway. | no | openai/gpt-5.6-terra:high |
| issue-number | Issue number to process. Defaults to the issue from the event payload. | no | "" |
| mode | auto, triage, investigate, fix, commit-review, pr-review, sweep, enqueue, or drain-queue | no | auto |
| allow-fix | Whether the action may create a fix branch and draft PR | no | false |
| allow-close | Whether trusted maintainer close/apply-close commands may close high-confidence issues | no | false |
| allow-security-ai | Whether suspected security-sensitive reports may be sent to pi/OpenAI. Defaults to false. | no | false |
| require-fix-command | Require a trusted watcher fix command before opening or updating fix PRs | no | false |
| command-mention | GitHub mention that triggers watcher issue-comment commands | no | @posthog-watcher |
| block-feature-fixes | Require explicit fix intent before opening fix PRs for feature requests | no | true |
| dry-run | Log intended GitHub mutations without applying them | no | false |
| labels | Comma-separated allowlist of labels the agent may add, or * to use all repository labels except managed labels | no | * |
| managed-label-prefix | Prefix for labels exclusively managed by this action | no | posthog-watcher: |
| sync-managed-labels | Whether to remove stale labels with managed-label-prefix before adding current managed labels | no | true |
| max-comments | Maximum issue comments to include in context | no | 20 |
| max-changed-files | Maximum changed files allowed for an autogenerated PR | no | 5 |
| max-diff-lines | Maximum diff lines allowed for an autogenerated PR | no | 500 |
| max-repair-attempts | Maximum pi repair attempts before giving up on a fix PR. Hard-capped at 3. | no | 2 |
| max-related-items | Maximum related same-repo issues/PRs to include as advisory triage context | no | 5 |
| validation-command | Optional shell command to validate an autogenerated fix before opening a PR | no | "" |
| reproduction-command | Optional shell command expected to fail before an issue fix and pass after it | no | "" |
| require-reproduction | Require a failing reproduction before issue fix PR attempts. Uses reproduction-command, or validation-command after pi adds a minimal regression check. | no | false |
| fix-pr-review-team | Optional team reviewer slug or org/team (for example acme/platform-reviewers) for generated fix PRs. Empty means no team review request. | no | "" |
| allow-pr-review | Whether pr-review mode may post code reviews (summary comment + inline diff comments) on pull requests. Only same-repo PRs are reviewed; fork PRs are always skipped so the model API key is never exposed to untrusted code. | no | false |
| max-review-files | Maximum changed files to include when reviewing a pull request in pr-review mode | no | 30 |
| max-review-findings | Maximum inline findings pr-review may post on a single pull request | no | 20 |
| commit-sha | Commit SHA to review when mode is commit-review. Defaults to github.sha. | no | "" |
| max-sweep-items | Maximum open issues to process in sweep mode | no | 10 |
| max-sweep-fix-items | Maximum sweep items that may attempt fixes. Defaults to 0. | no | 0 |
| sweep-query | GitHub search query suffix for sweep mode | no | is:issue is:open archived:false |
| skip-sweep-trusted-authors | Whether sweep mode skips issues created by trusted repository authors (OWNER, MEMBER, or COLLABORATOR), with a collaborator-permission fallback | no | true |
| queued-mode | Default processing mode stored by enqueue mode when no trusted watcher command is present. One of auto, triage, investigate, or fix. | no | auto |
| trigger-drain-workflow | In enqueue mode, dispatch drain-workflow after adding a new queue item. Requires actions: write permission. | no | false |
| drain-workflow | Workflow filename or ID to dispatch when trigger-drain-workflow is true | no | posthog-watcher-worker.yml |
| max-queue-items | Maximum queued items to drain sequentially in one drain-queue run | no | 5 |
| max-queue-attempts | Maximum failed drain attempts before dropping a queued item | no | 3 |
| max-pi-calls | Maximum pi calls allowed for this action run | no | 16 |
| pi-timeout-ms | Timeout in milliseconds for each pi subprocess | no | 600000 |
| pi-retries | Number of times to retry a failed pi subprocess before failing | no | 3 |
| approve-project-resources | Pass --approve to pi so host repository AGENTS.md, .pi, and .agents resources can be trusted in CI | no | false |
| state-enabled | Whether to write durable markdown state records, repo memory, and dashboard to state-branch | no | false |
| repo-memory-enabled | Whether to read/write advisory repo memory when state-enabled is true | no | true |
| progress-comments | Whether to update the marker-backed issue comment with in-progress phase/status updates | no | true |
| pi-session-sharing | Save captured pi JSONL session files and link resume instructions from watcher comments | no | false |
| pi-session-sharing-mode | Where to save captured pi JSONL session files. One of state-branch or gist | no | state-branch |
| pi-session-gist-token | Token with gist permission, required when pi-session-sharing-mode is gist | no | "" |
| state-repo | Repository for durable state as owner/repo. Defaults to current repository. | no | "" |
| state-branch | Branch for durable state records and dashboard | no | posthog-watcher-state |
| comment-marker | Hidden marker used to create/update durable comments and identify watcher-generated comments during security assessment | no | <!-- posthog-watcher-action --> |
| pi-version | Version of @earendil-works/pi-coding-agent to invoke with npx | no | 0.80.7 |
Outputs
| name | description |
|---|---|
| conclusion | Triage conclusion |
| labels | Labels selected by the agent after allowlist filtering |
| comment-url | Created or updated triage comment URL |
| pr-url | Draft PR URL, when a fix PR was created |
| closed | Whether the issue was closed by an explicit trusted close/apply-close command |
| triage-json | Raw normalized triage JSON |
| review-verdict | Pull request review verdict when mode is pr-review (clean, comment, or changes_requested) |