ci(labeler): reuse workflow to reduce duplication

This commit is contained in:
dundargoc 2023-04-22 23:28:39 +02:00 committed by GitHub
parent 8994389845
commit eee97300ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View File

@ -2,6 +2,7 @@ name: "Request reviews"
on:
pull_request_target:
types: [labeled, ready_for_review, reopened]
workflow_call:
jobs:
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false

View File

@ -3,7 +3,6 @@ on:
pull_request_target:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
permissions:
@ -33,16 +32,7 @@ jobs:
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
request-reviewer:
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
needs: ["triage", "type-scope"]
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: 'Request reviewers'
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/scripts/reviews.js')
await script({github, context})
uses: ./.github/workflows/add-reviewers.yml