claude-code/.github/workflows
Chris Lloyd 8c09097e8c
Post a comment when lifecycle labels are applied to issues (#25665)
When lifecycle labels (needs-info, needs-repro, invalid, stale, autoclose)
are applied to an issue, the author currently only sees a label change with
no explanation. They then get a closing comment days later without ever
being nudged to respond.

Add a GitHub Actions workflow that triggers on issues.labeled and runs a
new lifecycle-comment.ts script to post a comment explaining what's needed
and how long before auto-close.

Extract lifecycle config (labels, timeouts, close reasons, nudge messages)
into a shared issue-lifecycle.ts so the sweep script and comment script
stay in sync. Previously the timeouts were duplicated between the sweep
script and the comment messages.

- needs-info: asks for version, OS, error messages
- needs-repro: asks for steps to trigger the issue
- invalid: links to the Claude Code repo and Anthropic support
- stale/autoclose: explains inactivity auto-close

The script no-ops for non-lifecycle labels, so the workflow fires on every
label event and lets the script decide — single source of truth.

## Test plan

Dry-run all labels locally:
GITHUB_REPOSITORY=anthropics/claude-code LABEL=needs-info ISSUE_NUMBER=12345 bun run scripts/lifecycle-comment.ts --dry-run
GITHUB_REPOSITORY=anthropics/claude-code LABEL=needs-repro ISSUE_NUMBER=12345 bun run scripts/lifecycle-comment.ts --dry-run
GITHUB_REPOSITORY=anthropics/claude-code LABEL=invalid ISSUE_NUMBER=12345 bun run scripts/lifecycle-comment.ts --dry-run
GITHUB_REPOSITORY=anthropics/claude-code LABEL=stale ISSUE_NUMBER=12345 bun run scripts/lifecycle-comment.ts --dry-run
GITHUB_REPOSITORY=anthropics/claude-code LABEL=autoclose ISSUE_NUMBER=12345 bun run scripts/lifecycle-comment.ts --dry-run

Verified sweep.ts still works:
GITHUB_TOKEN=$(gh auth token) GITHUB_REPOSITORY_OWNER=anthropics GITHUB_REPOSITORY_NAME=claude-code bun run scripts/sweep.ts --dry-run
2026-02-13 19:39:10 -08:00
..
auto-close-duplicates.yml Restore dedupe workflows 2025-09-24 18:01:05 -07:00
backfill-duplicate-comments.yml Restore dedupe workflows 2025-09-24 18:01:05 -07:00
claude-dedupe-issues.yml chore: allow non-write users to trigger claude-code-action workflows 2026-01-14 18:11:06 -05:00
claude-issue-triage.yml Unify issue lifecycle labeling and sweep into a single system (#25352) 2026-02-12 11:45:31 -08:00
claude.yml ci: update claude-code-base-action and claude-code-action to v1 2026-01-09 18:24:29 -08:00
issue-lifecycle-comment.yml Post a comment when lifecycle labels are applied to issues (#25665) 2026-02-13 19:39:10 -08:00
issue-opened-dispatch.yml Update workflow 2025-09-05 15:26:12 -07:00
lock-closed-issues.yml Remove timeout-minutes from lock-closed-issues workflow (#5455) 2025-08-09 10:58:52 -07:00
log-issue-events.yml Add issue close event trigger to log-issue-events workflow 2025-08-22 18:30:52 -07:00
oncall-triage.yml chore: allow non-write users to trigger claude-code-action workflows 2026-01-14 18:11:06 -05:00
remove-autoclose-label.yml Revert "Revert "Add stale issue management workflows" (#9304)" (#12917) 2025-12-02 15:19:09 -08:00
sweep.yml Unify issue lifecycle labeling and sweep into a single system (#25352) 2026-02-12 11:45:31 -08:00