diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..d21d7af --- /dev/null +++ b/.github/labeler.yml @@ -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/**' diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml new file mode 100644 index 0000000..e57cd86 --- /dev/null +++ b/.github/workflows/labeler.yaml @@ -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