Merge pull request #16970 from dundargoc/ci/serialize-labeler-workflow

This commit is contained in:
James McCoy 2022-01-07 10:33:19 -05:00 committed by GitHub
commit b4fbb9dcf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
name: "Pull Request Labeler" name: "Pull Request Labeler"
on: on:
pull_request_target: pull_request_target:
types: opened types: [opened]
jobs: jobs:
triage: triage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -14,6 +14,7 @@ jobs:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: "${{ secrets.GITHUB_TOKEN }}"
type-scope: type-scope:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: ["triage"]
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
@ -25,6 +26,5 @@ jobs:
steps: steps:
# Extract type and try to add it as a label # Extract type and try to add it as a label
- run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true - run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
# Extract scope and try to add it as a label # Extract scope and try to add it as a label
- run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true - run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true