Skip to content

Commit

Permalink
ENH: Add labeler workflow
Browse files Browse the repository at this point in the history
Add labeler workflow so that a `GitHub` action, triggered when a PR is
opened, automatically labels the PR based on the given rules.

Exclude the `labeler.yaml` from the linter.
  • Loading branch information
jhlegarreta authored and dzenanz committed Sep 30, 2021
1 parent ca095ee commit 3f8d0a2
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
96 changes: 96 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Commit prefix regexes
type:Compiler:
title: "^COMP:.*"

type:Bug:
title: "^BUG:.*"

area:Documentation:
title: "^DOC:.*"

type:Enhancement:
title: "^ENH:.*"

type:Performance:
title: "^PERF:.*"

type:Style:
title: "^STYLE:.*"

type:Coverage:
title: "coverage"

type:Design:
title: "design"

# Filename regexes
area:Bridge:
files:
- "src/Bridge/*"

area:Core:
files:
- "src/Core/*"

area:Documentation:
files:
- "Documentation/*"
- "Documentation.rst"

area:Filtering:
files:
- "src/Filtering/*"

area:IO:
files:
- "src/IO/*"

area:Numerics:
files:
- "src/Numerics/*"

area:Nonunit:
files:
- "src/Nonunit/*"

area:Registration:
files:
- "src/Registration/*"

area:Remotes:
files:
- "src/Remote/*"

area:Segmentation:
files:
- "src/Segmentation/*"

area:Video:
files:
- "src/Video/*"

language:C++:
files:
- "Code.cxx"

language:Python:
files:
- "Code.py"

type:Python notebook:
files:
- ".*.ipynb"

type:Data:
files:
- ".*.sha512"

type:Infrastructure:
files:
- ".binder/*"
- ".github/*"
- "CMake/*"
- "Formatting/*"
- "Superbuild/*"
- "Utilities/*"
- "index.rst"
13 changes: 13 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Label PRs

on:
- pull_request_target

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: srvaroa/labeler@v0.8
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ jobs:
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_BLACK: true
VALIDATE_YAML: true
FILTER_REGEX_EXCLUDE: .github/labeler.yml
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 comment on commit 3f8d0a2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.