Skip to content

feat: add has_label_in condition - #11

Draft
rikakobayashi wants to merge 1 commit into
mainfrom
feat/has-label-in-condition
Draft

rikakobayashi wants to merge 1 commit into
mainfrom
feat/has-label-in-condition

Conversation

@rikakobayashi

Copy link
Copy Markdown

Summary

  • Add has_label_in rule condition that matches when any of the specified labels is attached to the PR
  • Follows the same OR semantics and naming pattern as has_author_in (labels: string[])
  • Enables use cases like relaxing/tightening the required approval count for PRs tagged hotfix, urgent, etc.

Example:

```json
{
"name": "hotfix",
"if": { "has_label_in": { "labels": ["hotfix", "urgent"] } },
"requires": { "count": 1 }
}
```

Test plan

  • Unit tests for hasLabelInCondition (single/multiple/empty/case-sensitivity)
  • pnpm test — 46 tests pass
  • pnpm typecheck clean
  • pnpm check (biome) clean
  • pnpm build — dist bundled
  • End-to-end verification on a real PR after merge (requires labeled/unlabeled event types in the workflow)

🤖 Generated with Claude Code

Allow rules to match PRs based on attached labels. Matches when any of
the specified labels is present on the PR (OR semantics, consistent with
has_author_in).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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