Skip to content

Commit

Permalink
add auto labeler
Browse files Browse the repository at this point in the history
  • Loading branch information
john0isaac committed Dec 15, 2024
1 parent c53e0a5 commit 64c3572
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Add 'root' label to any root file changes
# Quotation marks are required for the leading asterisk
root:
- changed-files:
- any-glob-to-any-file: '*'

# Add 'documentation' label to any file changes within 'docs' or 'guides' folders
# Add 'documentation' label to any change to .md files within the entire repository
documentation:
- changed-files:
- any-glob-to-any-file: ['docs/**', 'guides/**']
- any-glob-to-any-file: '**/*.md'

# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
source:
- all:
- changed-files:
- any-glob-to-any-file: 'src/**/*'
- all-globs-to-all-files: '!src/docs/*'

# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
feature:
- head-branch: ['^feature', 'feature', 'feat', '^feat']

bug:
- head-branch: ['^fix', 'fix', '^bug', 'bug', '^issue', 'issue']

# Add 'release' label to any PR that is opened against the `main` branch
release:
- base-branch: 'main'

ci-cd:
- changed-files:
- any-glob-to-any-file: '.github/workflows/**'

dev-tools:
- changed-files:
- any-glob-to-any-file: '.vscode/**'
- any-glob-to-any-file: '.devcontainer/**'
12 changes: 12 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5

0 comments on commit 64c3572

Please sign in to comment.