2021-05-18 00:37:18 -07:00
|
|
|
name: "Pull Request Labeler"
|
|
|
|
on:
|
2021-07-28 02:30:08 -07:00
|
|
|
pull_request_target:
|
2022-01-07 05:32:14 -07:00
|
|
|
types: [opened]
|
2021-05-18 00:37:18 -07:00
|
|
|
jobs:
|
|
|
|
triage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
2022-05-20 20:45:10 -07:00
|
|
|
- uses: actions/labeler@v4
|
2021-05-18 00:37:18 -07:00
|
|
|
with:
|
2022-02-14 13:16:36 -07:00
|
|
|
sync-labels: ""
|
2022-01-08 05:51:42 -07:00
|
|
|
|
2021-09-30 08:08:36 -07:00
|
|
|
type-scope:
|
2023-08-08 18:27:51 -07:00
|
|
|
needs: triage
|
2021-09-30 08:08:36 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
env:
|
2023-04-17 04:11:29 -07:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-15 07:08:12 -07:00
|
|
|
GH_REPO: ${{ github.repository }}
|
|
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
2021-09-30 08:08:36 -07:00
|
|
|
steps:
|
2022-01-08 05:51:42 -07:00
|
|
|
- name: "Extract commit type and add as label"
|
2022-02-11 08:09:12 -07:00
|
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
2022-01-08 05:51:42 -07:00
|
|
|
- name: "Extract commit scope and add as label"
|
2022-02-11 08:09:12 -07:00
|
|
|
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
2022-03-25 12:30:42 -07:00
|
|
|
- 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
|
2022-02-11 07:09:50 -07:00
|
|
|
|
2022-02-13 15:15:20 -07:00
|
|
|
request-reviewer:
|
|
|
|
needs: ["triage", "type-scope"]
|
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
2023-04-22 14:28:39 -07:00
|
|
|
uses: ./.github/workflows/add-reviewers.yml
|