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 <kilian@kilianpaquier.com>
  • Loading branch information
kilianpaquier committed Oct 6, 2024
1 parent b36bf50 commit 9cbc658
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 18 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
license: mit
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
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ run-name: CodeQL
on:
push:
branches:
- main
- master
- staging
- alpha
- beta
- dev
- develop
- development
- main
- master
- next
- beta
- alpha
- v[0-9]+.x
- staging
- v[0-9]+.[0-9]+.x
- v[0-9]+.x

jobs:
codeql:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ run-name: Go Dependency Submission
on:
push:
branches:
- main
- master
- staging
- alpha
- beta
- dev
- develop
- development
- main
- master
- next
- beta
- alpha
- v[0-9]+.x
- staging
- v[0-9]+.[0-9]+.x
- v[0-9]+.x

jobs:

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ on:
- ready_for_review
push:
branches:
- main
- master
- staging
- alpha
- beta
- dev
- develop
- development
- main
- master
- next
- beta
- alpha
- v[0-9]+.x
- staging
- v[0-9]+.[0-9]+.x
- v[0-9]+.x
workflow_dispatch:

jobs:
Expand Down
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 9cbc658

Please sign in to comment.