mirror of
https://github.com/neovim/neovim.git
synced 2026-03-03 23:02:36 +10:00
31 lines
939 B
YAML
31 lines
939 B
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
|
|
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
|