Skip to content

Commit dccc2c8

Browse files
committed
Add workflow to automatically label a PR by change type
1 parent d625ab6 commit dccc2c8

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

.github/label-pr.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"title_patterns": {
3+
"t:feature": ["feat", "feature", "tool"],
4+
"t:bugfix": ["fix", "bug", "bugfix"],
5+
"t:tech-debt": ["refactor", "chore", "cleanup", "revert", "debt", "test", "perf"],
6+
"t:docs": ["docs"],
7+
"t:ci": ["ci", "build", "chore(ci)"],
8+
"t:deps": ["deps", "[deps]"],
9+
"t:breaking-change": ["breaking", "breaking-change"],
10+
"t:misc": ["misc"],
11+
"t:llm": ["llm"]
12+
},
13+
"path_patterns": {
14+
"feature-flag": [],
15+
"t:feature": [],
16+
"t:tech-debt": [],
17+
"t:ci": [".checkmarx/", ".github/", "scripts/"],
18+
"t:docs": ["README.md", "CONTRIBUTING.md", "SECURITY.md"],
19+
"t:deps": [],
20+
"t:llm": [".claude/"]
21+
}
22+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Label PR
2+
run-name: Label PR #${{ github.event.pull_request.number }}
3+
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
8+
permissions: {}
9+
10+
jobs:
11+
label:
12+
name: Label PR
13+
runs-on: ubuntu-24.04
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
steps:
18+
- name: Check out repo
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
persist-credentials: false
22+
23+
- name: Label PR
24+
uses: bitwarden/gh-actions/auto-label-pr-sdlc@main
25+
with:
26+
pr-number: ${{ github.event.pull_request.number }}
27+
pr-labels: ${{ toJSON(github.event.pull_request.labels) }}
28+
mode: add
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)