From cab30f54d2b93f0c9c3485a672c4e68e7b31f6cb Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Thu, 15 Feb 2024 16:42:42 -0800 Subject: [PATCH] .guthub: Add PatchCheckOnLabelChange Signed-off-by: Michael D Kinney --- .github/workflows/patchcheck.yml | 2 +- .github/workflows/patchcheckonlabelchange.yml | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/patchcheckonlabelchange.yml diff --git a/.github/workflows/patchcheck.yml b/.github/workflows/patchcheck.yml index ce881d2d2898..591162bdf4c1 100644 --- a/.github/workflows/patchcheck.yml +++ b/.github/workflows/patchcheck.yml @@ -9,7 +9,7 @@ name: PatchCheck on: pull_request: - types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + types: [opened, synchronize, reopened, ready_for_review] branches: - CiEnabled diff --git a/.github/workflows/patchcheckonlabelchange.yml b/.github/workflows/patchcheckonlabelchange.yml new file mode 100644 index 000000000000..2645b60ef09b --- /dev/null +++ b/.github/workflows/patchcheckonlabelchange.yml @@ -0,0 +1,37 @@ +## @file +# Run PatchCheck on a label change in a pull request +# +# Copyright (c) 2024, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +name: PatchCheckOnLabelChange + +on: + pull_request: + types: [labeled, unlabeled] + branches: + - CiEnabled + +jobs: + patchcheck: + if: ${{ (github.event.pull_request.draft == false) && (github.event.label.name == 'ignore-multi-package') }} + runs-on: ubuntu-latest + steps: + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Checkout PR + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - name: Install Python Dependencies + run: pip install -r pip-requirements.txt + - name: PatchCheck + if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-multi-package') }} + run: python BaseTools/Scripts/PatchCheck.py ${{ github.event.pull_request.base.sha }}.. + - name: PatchCheck --ignore-multi-package + if: ${{ contains(github.event.pull_request.labels.*.name, 'ignore-multi-package') }} + run: python BaseTools/Scripts/PatchCheck.py --ignore-multi-package ${{ github.event.pull_request.base.sha }}..