diff --git a/.github/labeler-config.yml b/.github/labeler-config.yml new file mode 100644 index 00000000..b1316a4e --- /dev/null +++ b/.github/labeler-config.yml @@ -0,0 +1,49 @@ +filters: + - label: 'new feature' + regexs: + - /\bfeat\b/ + - /feature/i + events: [pull_request] + targets: [title] + + - label: 'documentation' + regexs: + - /docs/i + events: [pull_request] + targets: [title] + + - label: 'bug' + regexs: + - /bug/i + events: [pull_request] + targets: [title] + - label: 'bug' + regexs: + - /fix/i + events: [pull_request] + targets: [title] + + - label: 'chore' + regexs: + - /description/i + events: [pull_request] + targets: [title] + + - label: 'chore' + regexs: + - /chore/i + events: [pull_request] + targets: [title] + + - label: 'goal: build' + regexs: + - /build/i + events: [pull_request] + targets: [title] + + - label: 'goal: refactor' + regexs: + - /\brefactor\b/ + - /refactor/i + events: [pull_request] + targets: [title] diff --git a/.github/workflows/add-labels-pr.yml b/.github/workflows/add-labels-pr.yml new file mode 100644 index 00000000..92188d3b --- /dev/null +++ b/.github/workflows/add-labels-pr.yml @@ -0,0 +1,24 @@ +# reference: https://github.com/hoho4190/issue-pr-labeler +name: PR Labeler + +on: + pull_request_target: + types: + - opened + - reopened + +jobs: + main: + runs-on: ubuntu-latest + + permissions: + contents: read # to read configuration yml file + pull-requests: write # to add labels to pull requests + + steps: + - name: Run PR Labeler + uses: hoho4190/issue-pr-labeler@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file-name: labeler-config.yml + # disable-bot: true # this will prevent issues, PRs created by bots