Skip to content

Commit ed13b03

Browse files
Merge pull request #67 from loss-and-quick/chore/pr-auto-label
ci: auto-label PRs by changed paths
2 parents fd82105 + 52e0971 commit ed13b03

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/labeler.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Path-based PR labels (actions/labeler v5). Maps changed files to the same
2+
# taxonomy as the PR template's "Affected layer" + the platform:* labels the bug
3+
# form sets on issues. A PR can carry several (e.g. a desktop change touching both
4+
# the linux dir and the frontend).
5+
6+
frontend:
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- "frontend/**"
10+
- "package.json"
11+
- "bun.lock"
12+
- "biome.json"
13+
14+
backend:
15+
- changed-files:
16+
- any-glob-to-any-file:
17+
- "crates/**"
18+
- "src-tauri/**"
19+
- "Cargo.toml"
20+
- "Cargo.lock"
21+
22+
"platform:linux":
23+
- changed-files:
24+
- any-glob-to-any-file:
25+
- "src-tauri/src/desktop/linux/**"
26+
27+
"platform:windows":
28+
- changed-files:
29+
- any-glob-to-any-file:
30+
- "src-tauri/src/desktop/windows/**"
31+
32+
"platform:android":
33+
- changed-files:
34+
- any-glob-to-any-file:
35+
- "module/**"
36+
- "crates/kasumi-daemon/**"
37+
38+
ci:
39+
- changed-files:
40+
- any-glob-to-any-file:
41+
- ".github/**"
42+
43+
documentation:
44+
- changed-files:
45+
- any-glob-to-any-file:
46+
- "**/*.md"

.github/workflows/label-pr.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Label PR
2+
3+
# Auto-label PRs by the files they touch (config: .github/labeler.yml), mirroring
4+
# the platform labelling the bug form does for issues. `pull_request_target` so it
5+
# has write scope on PRs from forks; labeler only reads the diff's file list and the
6+
# config from the base branch — it never checks out or runs PR code, so it's safe.
7+
on:
8+
pull_request_target:
9+
types: [opened, synchronize, reopened]
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
jobs:
16+
label:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5

0 commit comments

Comments
 (0)