From 806e670d1f47615e9a995838f31f0f2e44f4e8f8 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 7 Aug 2024 23:11:50 -0700 Subject: [PATCH 1/3] Fixing this to stop breaking PRs --- .github/workflows/third-party-check.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/third-party-check.yaml b/.github/workflows/third-party-check.yaml index 575e7e3c9c7137..c06bd545e4e483 100644 --- a/.github/workflows/third-party-check.yaml +++ b/.github/workflows/third-party-check.yaml @@ -17,7 +17,7 @@ name: Check for Unintentional Submodule Updates on: pull_request: branches-ignore: - - 'dependabot/**' + - "dependabot/**" paths: - "third_party/**" - ".gitmodules" @@ -26,9 +26,14 @@ jobs: check-submodule-update-label: name: Check For Submodule Update Label runs-on: ubuntu-latest - if: "!contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose')" steps: - - name: Error Message - run: echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes. - - name: Fail Job - run: exit 1 + - if: contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == false + name: Fail + run: | + echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes. + exit 1 + - if: contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == true + name: Success + run: | + echo PR looks good. + exit 0 From 099826bf2badab930504db20722d60bbc0163702 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 7 Aug 2024 23:18:27 -0700 Subject: [PATCH 2/3] Qualifying as expression --- .github/workflows/third-party-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/third-party-check.yaml b/.github/workflows/third-party-check.yaml index c06bd545e4e483..b9b144ce6168a2 100644 --- a/.github/workflows/third-party-check.yaml +++ b/.github/workflows/third-party-check.yaml @@ -27,12 +27,12 @@ jobs: name: Check For Submodule Update Label runs-on: ubuntu-latest steps: - - if: contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == false + - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == false }} name: Fail run: | echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes. exit 1 - - if: contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == true + - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == true }} name: Success run: | echo PR looks good. From b00342be3b0939a045c77fce5409bbbb2f3c43be Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 7 Aug 2024 23:19:24 -0700 Subject: [PATCH 3/3] Making this more readable now that it's an expression --- .github/workflows/third-party-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/third-party-check.yaml b/.github/workflows/third-party-check.yaml index b9b144ce6168a2..beda0af41b0622 100644 --- a/.github/workflows/third-party-check.yaml +++ b/.github/workflows/third-party-check.yaml @@ -27,12 +27,12 @@ jobs: name: Check For Submodule Update Label runs-on: ubuntu-latest steps: - - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == false }} + - if: ${{ !contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} name: Fail run: | echo This pull request attempts to update submodules without the changing-submodules-on-purpose label. Please apply that label if the changes are intentional, or remove those changes. exit 1 - - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') == true }} + - if: ${{ contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} name: Success run: | echo PR looks good.