lego/Copilot PR Babysitter
Babysits open GitHub Copilot pull requests until they are ready for human review: fetches Copilot-authored PRs matching a title identifier, uses a fresh read-only Claude session per PR to attribute CI failures and synthesise fix instructions, pings @copilot to address review comments / real breakage, re-runs flaky checks, and posts a Teams "ready for review" card once CI is green and all automated reviews are resolved. Idempotent: never double-pings.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| title-pattern | Identifier that must appear ANYWHERE in a PR title for it to be babysat (e.g. "PMO-"). Regex if it contains regex metacharacters, else a plain substring. Empty = babysit all Copilot-authored PRs. Not shared org-wide; set it to your team's convention. | no | "" |
| github-token | Token for reads, job re-runs, and marker comments. The default GITHUB_TOKEN works if the job grants contents:read, actions:write, pull-requests:write. | no | ${{ github.token }} |
| copilot-token | OAuth user-to-server token from a Copilot-licensed account. Authors the @copilot mention that wakes the coding agent. PATs may not trigger it. | yes | — |
| anthropic-base-url | Base URL for the Anthropic-compatible model endpoint the CLI calls. | yes | — |
| anthropic-auth-token | Bearer token for the model endpoint. Pass from a secret. | yes | — |
| model | Model name/id passed to the Claude CLI --model flag (your proxy's model identifier). | yes | — |
| policy-file | Path (relative to the consuming repo checkout) to a Markdown file of repository-specific policy appended to the invariant babysitter prompt as a "Layer 2" addendum. Use it to encode repo quirks the general action must not bake in — e.g. "a named advisory gate check greens only after human review, so never treat it as a CI failure to fix or re-run". It may add or narrow rules only; it cannot change Claude's read-only role or the output JSON schema. Empty = no repo policy. | no | "" |
| teams-webhook-url | Power Automate / Teams incoming webhook. If empty, "ready" is logged but not posted. | no | "" |
| max-prs | Cap on PRs processed per run (blast-radius guard). | no | 20 |
| rerun-cap | Max automatic re-runs per flaky check per PR before escalating it as a real failure. | no | 2 |
| max-turns | Per-PR Claude session turn cap. | no | 15 |
| max-diff-bytes | Cap on PR diff bytes fed into the Claude prompt (truncated beyond). | no | 60000 |
| max-log-lines | Tail lines of each failing job log fed into the Claude prompt. | no | 200 |
| max-log-bytes | Byte cap on each failing job log tail fed into the Claude prompt (applied after max-log-lines; guards against very long log lines). | no | 40000 |
| dry-run | When "true", assess + upload artifact only — no pings, re-runs, comments, or Teams. | no | false |
| node-version | Node.js version used to run the babysitter scripts. | no | 24 |
Outputs
no outputs