mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
ci: add type and scope from PR title as labels #15850
This only works if the label exists in the first place of course.
This commit is contained in:
parent
270cc1d70f
commit
7152353ade
16
.github/workflows/labeler.yml
vendored
16
.github/workflows/labeler.yml
vendored
@ -12,3 +12,19 @@ jobs:
|
||||
- uses: actions/labeler@main
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
type-scope:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- run: gh pr checkout ${{ github.event.pull_request.number }}
|
||||
|
||||
# Extract type and try to add it as a label
|
||||
- run: gh pr edit --add-label "$(echo "${{ github.event.pull_request.title }}" | sed -E 's|([[:alpha:]]+)(\(.*\))?:.*|\1|')" || true
|
||||
|
||||
# Extract scope and try to add it as a label
|
||||
- run: gh pr edit --add-label "$(echo "${{ github.event.pull_request.title }}" | sed -E 's|[[:alpha:]]+\((.+)\):.*|\1|')" || true
|
||||
|
Loading…
Reference in New Issue
Block a user