Skip to content

Commit

Permalink
ci: add autolabeler feature for PR
Browse files Browse the repository at this point in the history
Signed-off-by: kilianpaquier <[email protected]>
  • Loading branch information
kilianpaquier committed Oct 6, 2024
1 parent 96828a9 commit db9b760
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
1 change: 1 addition & 0 deletions .craft
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ci:
options:
- codecov
- codeql
- labeler
release:
auto: true
docker:
Expand Down
95 changes: 95 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Code generated by craft; DO NOT EDIT.

# https://github.com/marketplace/actions/release-drafter#autolabeler

autolabeler:
- label: enhancement
title:
- /feat\/.+/
- /refactor\/.+/
branch:
- /dev\/.+/

- label: breaking
body:
- /.*BREAKING.*/

- label: bug
title:
- /fix\/.+/
- /perf\/.+/
- /revert\/.+/
branch:
- /(hot)?fix\/.+/

- label: documentation
title:
- /doc(s)?\/.+/
branch:
- /doc(s)?\/.+/
files:
- "**/*.md"
- "**/doc.go"
- "**/docs/**"

- label: chore
title:
- /chore\/.+/

- label: test
title:
- /test\/.+/
branch:
- /test\/.+/
files:
- "**/*_test.go"
- "**/*.spec.js"
- "**/*.spec.ts"
- "**/*.test.js"
- "**/*.test.ts"
- "**/test/**"
- "**/testdata/**"
- "**/tests/**"

- label: github_actions
files:
- "action.yml"
- "**/.github/actions/**"
- "**/.github/workflows/**"

- label: go
files:
- "**/*.go"

- label: javascript
files:
- "**/*.js"

- label: python
files:
- "**/*.py"

- label: rust
files:
- "**/*.rs"

- label: shell
files:
- "**/*.sh"
- "**/*.zsh"
- "**/*.bash"

- label: typescript
files:
- "**/*.ts"

- label: dependencies
title:
- /.*\(deps\).*/
# files:
# - "**/go.mod"
# - "**/go.sum"
# - "**/package.json"

template: |
$CHANGES
40 changes: 40 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Code generated by craft; DO NOT EDIT.

name: Labeler
run-name: Labeler

on:
pull_request: # autolabeler on project pull requests
types:
- opened
- reopened
- synchronize
# pull_request_target: # autolabeler on fork pull requests
# types:
# - opened
# - reopened
# - synchronize

jobs:

labeler:
name: Labeler
runs-on: ubuntu-latest
permissions:
contents: read # enfore rights to specify no release, even draft, is created
pull-requests: write
steps:
# https://github.com/marketplace/actions/release-drafter
- id: drafter
uses: release-drafter/release-drafter@v6
with:
commitish: ${{ github.base_ref }}
config-name: labeler.yml
latest: false
name: v$RESOLVED_VERSION
prerelease-identifier: labeler
prerelease: true
publish: false
tag: v$RESOLVED_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit db9b760

Please sign in to comment.