Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auto labeler #89

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/**'
16 changes: 16 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull Request Labeler

on:
workflow_dispatch:
pull_request_target:

permissions:
contents: read
pull-requests: write

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/labeler@v5
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.12
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand All @@ -21,4 +21,4 @@ repos:
- id: ruff
args: ["--fix"]
# Run the formatter.
- id: ruff-format
- id: ruff-format
Loading