mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
name: "Pull Request Labeler"
|
|
on:
|
|
pull_request_target:
|
|
types: [opened]
|
|
jobs:
|
|
|
|
triage:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/labeler@main
|
|
with:
|
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
type-scope:
|
|
runs-on: ubuntu-latest
|
|
needs: ["triage"]
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
steps:
|
|
- name: "Extract commit type and add as label"
|
|
continue-on-error: true
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
|
|
- name: "Extract commit scope and add as label"
|
|
continue-on-error: true
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')"
|