Skip to content

Commit a5781ea

Browse files
authored
add auto labeler (#88)
* fix pre-commit * add auto labeler
1 parent 828a819 commit a5781ea

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

.github/labeler.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Add 'root' label to any root file changes
2+
# Quotation marks are required for the leading asterisk
3+
root:
4+
- changed-files:
5+
- any-glob-to-any-file: '*'
6+
7+
# Add 'documentation' label to any file changes within 'docs' or 'guides' folders
8+
# Add 'documentation' label to any change to .md files within the entire repository
9+
documentation:
10+
- changed-files:
11+
- any-glob-to-any-file: ['docs/**', 'guides/**']
12+
- any-glob-to-any-file: '**/*.md'
13+
14+
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
15+
source:
16+
- all:
17+
- changed-files:
18+
- any-glob-to-any-file: 'src/**/*'
19+
- all-globs-to-all-files: '!src/docs/*'
20+
21+
# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
22+
feature:
23+
- head-branch: ['^feature', 'feature', 'feat', '^feat']
24+
25+
bug:
26+
- head-branch: ['^fix', 'fix', '^bug', 'bug', '^issue', 'issue']
27+
28+
# Add 'release' label to any PR that is opened against the `main` branch
29+
release:
30+
- base-branch: 'main'
31+
32+
ci-cd:
33+
- changed-files:
34+
- any-glob-to-any-file: '.github/workflows/**'
35+
36+
dev-tools:
37+
- changed-files:
38+
- any-glob-to-any-file: '.vscode/**'
39+
- any-glob-to-any-file: '.devcontainer/**'

.github/workflows/labeler.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
labeler:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v5

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
default_language_version:
4-
python: python3.12
4+
python: python3.12
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
77
rev: v4.5.0
@@ -21,4 +21,4 @@ repos:
2121
- id: ruff
2222
args: ["--fix"]
2323
# Run the formatter.
24-
- id: ruff-format
24+
- id: ruff-format

0 commit comments

Comments
 (0)