Skip to content

Commit

Permalink
chore: Update GitHub CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Oct 27, 2023
1 parent 17e68bc commit 2ae4672
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
50 changes: 37 additions & 13 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,49 @@
name: semgrep
name: Semgrep

on:
pull_request_target: {}

merge_group:
pull_request_target:
types:
- opened
- synchronize
push:
branches: [main]

branches:
- master
schedule:
- cron: '30 0 1,15 * *'
- cron: "30 0 1,15 * *"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
scan:
authorize:
name: Authorize
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:
needs: authorize # Require approval before running on forked pull requests

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

container:
image: returntocorp/semgrep

# Skip any PR created by dependabot to avoid permission issues
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@main
- name: Run Semgrep to check for vulnerabilities
run: semgrep ci
- 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@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- run: semgrep ci
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_TOKEN }}
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}

0 comments on commit 2ae4672

Please sign in to comment.