From 7104d2c317a83c88a7030ac829895e78db386d1c Mon Sep 17 00:00:00 2001 From: Kaizen Conroy <36202692+kaizen3031593@users.noreply.github.com> Date: Wed, 23 Mar 2022 15:33:47 -0400 Subject: [PATCH] chore: introduce pr-triage-manager to pr-labeler workflow (#19530) `pr-triage-manager` will copy labels from linked issues to the PR. Only linked issues that will be closed when the PR is merged will be used. If a PR will close multiple issues, the highest priority will be selected. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .github/workflows/pr-labeler.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 1619f8bc4cc7e..0c639636e5ede 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -3,7 +3,10 @@ name: pr-labeler on: pull_request: - types: [ opened ] + types: + - opened + - edited + - reopened jobs: auto-approve: @@ -13,6 +16,16 @@ jobs: pull-requests: write issues: write steps: - - run: gh pr edit ${{ github.event.pull_request.number }} --add-label "auto-approve" -R ${{ github.repository }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: gh pr edit ${{ github.event.pull_request.number }} --add-label "auto-approve" -R ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + copy-labels: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: kaizen3031593/pr-triage-manager@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + +