Skip to content

ci: label pull requests by type and close stale needs-info issues - #113

Merged
lidge-jun merged 1 commit into
devfrom
codex/pr-lifecycle-hygiene
Sep 9, 2026
Merged

ci: label pull requests by type and close stale needs-info issues#113
lidge-jun merged 1 commit into
devfrom
codex/pr-lifecycle-hygiene

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

What

Two low-cost lifecycle automations ported from opencodex, per dev-devops repo-bootstrap/agent-intake direction for an agent-PR-heavy repository.

PR Labeler (pr-labeler.yml + .github/scripts/pr-labeler.{cjs,test.cjs})

  • Syncs a type label (enhancement / bug / documentation / chore) from the conventional-commit PR title, falling back to the PR's commit messages when the title does not classify (stack 3/5: ...).
  • Sticky human override: once a non-bot actor changes a managed type label, the bot never reverts it (issue-event timeline check).
  • pull_request_target with the script checked out from the trusted default branch, persist-credentials: false, SHA-pinned actions (checkout v7, github-script v9 — the pins this repo already uses).
  • Creates a missing managed label itself (chore does not exist yet here).
  • 24 unit tests, wired into npm test.

Stale needs-info (stale-needs-info.yml)

  • Scheduled actions/stale (pinned v10.4.0) over needs-info issues only: 14-day warn, 7-day close as not_planned, any update resets the clock. PRs are excluded entirely. Schedule-only trigger; the stale label is auto-created.

Activation caveat

Both workflows load from the default branch (main): pull_request_target and schedule ignore dev. Merging this PR into dev changes no live behavior until promotion — the PR is the review surface, not the activation.

Merge-order note

Independent of #111 (branch cleanup) and #112 (release hardening) by file, but #111 also touches the package.json test line and the README test-count badges. Whichever of #111/this PR lands second needs a one-line rebase: re-add its test path and re-run inventory.mjs --write --tests <remeausured>. Flagged here so it does not read as drift.

Verification

  • node --test .github/scripts/pr-labeler.test.cjs — 24/24 pass.
  • Full suite (CODEXCLAW_SKIP_REPOMAP_SMOKE=1 npm test): 2773 tests, 0 fail; badges/inventory republished to 2773.
  • gate.mjs OK; actionlint clean on both workflows.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T05:46:33.619884Z 262b383 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun force-pushed the codex/pr-lifecycle-hygiene branch from 262b383 to e4825ce Compare September 9, 2026 15:34
Two low-cost lifecycle automations ported from opencodex:

- pr-labeler.yml + .github/scripts/pr-labeler.{cjs,test.cjs}: sync a
  type label (enhancement/bug/documentation/chore) from the
  conventional-commit PR title, falling back to commit messages for
  titles that do not classify. A human label change is a sticky
  override the bot never reverts. Trusted default-branch script under
  pull_request_target; creates missing managed labels itself.
- stale-needs-info.yml: scheduled actions/stale over needs-info issues
  only (PRs excluded), 14-day warn, 7-day close as not_planned, any
  update resets the clock. Schedule-only trigger; the stale label is
  auto-created.

Both workflows activate on promotion to the default branch (main):
pull_request_target and schedule load from main, so landing on dev
alone changes no live behavior.

Suite: 2773 tests, 0 fail (24 new labeler tests wired into npm test);
inventory and README badges republished; gate OK; actionlint clean.
@lidge-jun
lidge-jun force-pushed the codex/pr-lifecycle-hygiene branch from e4825ce to 3fe44dc Compare September 9, 2026 15:40
@lidge-jun
lidge-jun merged commit d1f08e4 into dev Sep 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant