Skip to content

Commit

Permalink
Refactor Dependabot checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Aug 28, 2023
1 parent bf42e1e commit 986039f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ permissions:

jobs:
analyze:
# Skip running test for dependabot.
if: (github.actor != 'dependabot[bot]')

name: Analyze
runs-on: ubuntu-latest

Expand All @@ -32,8 +29,8 @@ jobs:
language: [javascript]

steps:
- if: github.event_name == 'merge_group'
run: exit 0 # Skip running test for merge queues.
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.

- name: Checkout
uses: actions/checkout@v3
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ permissions:
jobs:
authorize:
name: Authorize
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

run:
# Skip running test for dependabot.
if: (github.actor != 'dependabot[bot]')

needs: authorize # Require approval before running on forked pull requests

name: Check for Vulnerabilities
Expand All @@ -36,8 +33,8 @@ jobs:
image: returntocorp/semgrep

steps:
- if: github.event_name == 'merge_group'
run: exit 0 # Skip running test for merge queues.
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.

- uses: actions/checkout@v3
with:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,20 @@ concurrency:
jobs:
authorize:
name: Authorize
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

check:
# Skip running test for dependabot.
if: (github.actor != 'dependabot[bot]')
needs: authorize

name: Check for Vulnerabilities
runs-on: ubuntu-latest

steps:
- if: github.event_name == 'merge_group'
run: exit 0 # Skip running test for merge queues.
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.

- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ concurrency:
jobs:
authorize:
name: Authorize
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
Expand Down

0 comments on commit 986039f

Please sign in to comment.