Skip to content

Commit

Permalink
Add dependabot as conditional to not fail checks. (#37743)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
andy31415 authored Feb 24, 2025
1 parent 8a87131 commit 86b9677
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand All @@ -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)'
8 changes: 4 additions & 4 deletions .github/workflows/third-party-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 86b9677

Please sign in to comment.