From 06a323772993a6fc702f131a715dbc498b1421ae Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:19:24 -0500 Subject: [PATCH] Add workflow to apply needs-qa label (#4727) * Added new workflow * Fixed quotes. * Added step to job. * Added check for PR destination branch. * Changed criteria. * Added fork check for community PRs. * Removed space * Changed name. * Updated with more filters. * Changed to target approval for adding the label. * Lint * Refactored to use pull_request_target instead. * Fixed comment * pull_request_target isn't supported, so pull_request instead * Added comment about target branch. --- .../workflows/label-issue-pull-request.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/label-issue-pull-request.yml diff --git a/.github/workflows/label-issue-pull-request.yml b/.github/workflows/label-issue-pull-request.yml new file mode 100644 index 0000000000..01d626bb1d --- /dev/null +++ b/.github/workflows/label-issue-pull-request.yml @@ -0,0 +1,23 @@ +# Runs creation of Pull Requests +# If the PR destination branch is master, add a needs-qa label +--- +name: Label Issue Pull Request + +on: + pull_request: + types: + - [opened, synchronize, edited] # Check when PR is opened, new pushes are made, or target branch is edited + paths-ignore: + - .github/workflows/** # We don't need QA on workflow changes + branches: + - 'master' # We only want to check when PRs target master + +jobs: + add-needs-qa-label: + runs-on: ubuntu-latest + steps: + - name: Add label to pull request + uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 + if: ${{ !github.event.pull_request.head.repo.fork }} + with: + add-labels: "needs-qa"