Skip to content

feat(label): add hook auto-labeling issues and pull requests - #44

Open
Osheun wants to merge 1 commit into
calebephrem:mainfrom
Osheun:feat/label-hook
Open

feat(label): add hook auto-labeling issues and pull requests#44
Osheun wants to merge 1 commit into
calebephrem:mainfrom
Osheun:feat/label-hook

Conversation

@Osheun

@Osheun Osheun commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

New label hook, as requested in #36. Just like assign, it is rule-based:

  • Keyword rules — case-insensitive, whole-word title matching, applied to both issues and PRs
  • Path rules — glob matching (minimatch, same as assign) against a PR's changed files, PRs only

Both rule sets ship with sensible defaults that kick in when the hook is enabled without further config:

  • keywords: bug (fix, bug, crash, error, broken), enhancement (feat, feature, add, improve, support), documentation (docs, documentation, readme, typo)
  • paths: documentation (**/*.md, docs/**), tests (tests/**, **/*.test.*, ...), dependencies (package.json, **/*.lock, ...)

Defining your own keywords/paths replaces the defaults. Matched labels are deduplicated and applied in a single addLabels call; no API call is made when nothing matches.

hooks:
  label:
    enabled: false # default

Changes

  • src/app/hooks/label/issueOpen.ts (issues.opened), prOpen.ts (pull_request opened/reopened/synchronize), pure matchers.ts, schema.ts
  • schema registered in src/schemas/hooks.ts
  • documented in HOOKS.md with a config example
  • tests in tests/app/hooks/label.test.ts covering matchers, defaults, custom rules, dedup and disabled state

No new permissions/events needed (issues: write and the issues/pull_request events are already in app.yml).

Closes #36

@hookto

hookto Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Thanks for opening this PR!

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@Osheun is attempting to deploy a commit to the Caleb's Projects Team on Vercel.

A member of the Team first needs to authorize it.

@hookto

hookto Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Note

All commit messages follow Conventional Commits standard.

Labels issues and PRs from title keyword matching (both), and PRs
from changed file path globs. Ships with sensible default keyword
and path rules that apply when the hook is enabled without config.

Closes calebephrem#36
@hookto

hookto Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Note

All commits and the PR title adhere to the Conventional Commits specification. Good to go!

@calebephrem calebephrem added the duplicate This issue or pull request already exists label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New hook: label

2 participants