Skip to content

Commit

Permalink
chore(config): automatically label PRs based on modifications to save…
Browse files Browse the repository at this point in the history
… eng time #1720

ISSUE: #1720

CHANGELOG:
- [ ] Configure the following files to set up the labeler action:
  - [ ] `.github/workflows/labeler.yml`
  - [ ] `.github.com/labeler.yml`
  • Loading branch information
yesudeep committed Feb 3, 2025
1 parent f63e658 commit 199ac6a
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Add 'root' label to any root file changes
# Quotation marks are required for the leading asterisk
root:
- changed-files:
- any-glob-to-any-file: '*'

docs:
- changed-files:
- any-glob-to-any-file:
- '**/*.md'
- '**/*.rst'
- 'LICENSE'
- 'docs-go/**'
- 'docs/**'
- 'py/engdocs/**'

go:
- changed-files:
- any-glob-to-any-file:
- '**/*.go'
- '**/go.mod'
- '**/go.sum'
- 'go/**'

python:
- changed-files:
- any-glob-to-any-file:
- '**/*.py'
- '**/pyproject.toml'
- 'py/**'

js:
- changed-files:
- any-glob-to-any-file:
- '**/*.js'
- '**/*.jsx'
- '**/*.ts'
- '**/*.tsx'
- '**/package.json'
- 'js/**'

tooling:
- changed-files:
- any-glob-to-any-file:
- 'genkit-tools/**'

config:
- changed-files:
- any-glob-to-any-file:
- '**/*.toml'
- '**/*.yaml'
- '**/*.yml'
- '**/.editorconfig'
- '**/.github/**'
- '**/.gitignore'
- '**/.npmignore'
- '**/.npmrc'
- '**/.prettierignore'
- '**/package.json'
- '**/tsconfig.*.json'
- '**/tsconfig.json'
- '**/typedoc.json'

sample:
- changed-files:
- any-glob-to-any-file:
- 'samples/**'

dotprompt:
- changed-files:
- any-glob-to-any-file:
- '**/dotprompt/**'

handlebarz:
- changed-files:
- any-glob-to-any-file:
- '**/handlebarz/**'

# Automatically add labels to any PR also based on branch naming conventions.
build:
- head-branch: [^.*/build/.*, build]

chore:
- head-branch: [^.*/chore/.*, chore]

ci:
- head-branch: [^.*/ci/.*, ci]

feature:
- head-branch: [^.*/feat/.*, feature]

fix:
- head-branch: [^.*/fix/.*, fix]

perf:
- head-branch: [^.*/perf/.*, perf]

refactor:
- head-branch: [^.*/refactor/.*, refactor]

style:
- head-branch: [^.*/style/.*, style]

test:
- head-branch: [^.*/test/.*, test]
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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 199ac6a

Please sign in to comment.