mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
name: "labeler: PR"
|
|
on:
|
|
pull_request_target:
|
|
types: [opened]
|
|
jobs:
|
|
changed-files:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/labeler@v5
|
|
with:
|
|
configuration-path: .github/scripts/labeler_configuration.yml
|
|
|
|
type-scope:
|
|
needs: changed-files
|
|
runs-on: ubuntu-latest
|
|
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"
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
|
- name: "Extract commit scope and add as label"
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
|
- name: "Extract if the PR is a breaking change and add it as label"
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
|
|
|
|
request-reviewer:
|
|
needs: ["changed-files", "type-scope"]
|
|
permissions:
|
|
pull-requests: write
|
|
uses: ./.github/workflows/reviewers_add.yml
|