From 86b96773b7e4ff5930447d9f4ebcea04d35f7af9 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 24 Feb 2025 09:33:39 -0500 Subject: [PATCH] Add dependabot as conditional to not fail checks. (#37743) * Add dependabot as conditional to not fail checks. Dependabot almost always changes submodules and has its own template for PRs. Remove some of the checks for PRs created by dependabot. * Fix dependabot name --- .github/workflows/pr-validation.yaml | 5 +++-- .github/workflows/third-party-check.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index d34867f7accec3..8d94eb823f078c 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -45,7 +45,7 @@ jobs: # }) - name: Fail if PR instructions were not deleted - if: steps.check-instructions.outcome == 'failure' + if: (steps.check-instructions.outcome == 'failure') && (github.event.pull_request.user.login != 'dependabot[bot]') run: | python -c 'import sys; print("PR instructions were not replaced"); sys.exit(1)' @@ -63,7 +63,8 @@ jobs: # }) - name: Fail if `### Testing` section not in PR - if: steps.check-testing.outcome == 'failure' + if: (steps.check-testing.outcome == 'failure') && (github.event.pull_request.user.login != 'dependabot[bot]') + run: | python -c 'import sys; print("Testing section missing (test failed)"); sys.exit(1)' diff --git a/.github/workflows/third-party-check.yaml b/.github/workflows/third-party-check.yaml index ad072da755892f..b8f1656d9b4a73 100644 --- a/.github/workflows/third-party-check.yaml +++ b/.github/workflows/third-party-check.yaml @@ -28,13 +28,13 @@ jobs: name: Check For Submodule Update Label runs-on: ubuntu-latest steps: - - if: ${{ !contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') }} - name: Fail + - name: Fail + if: (github.event.pull_request.user.login != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') 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') }} - name: Success + - name: Success + if: contains(github.event.pull_request.labels.*.name, 'changing-submodules-on-purpose') run: | echo PR looks good. exit 0