Skip to content

Commit 7cfd8d1

Browse files
authored
Merge pull request #48 from sandbox-quantum/semgrep_integration
Create semgrep.yml
2 parents 716cde7 + 3813cb8 commit 7cfd8d1

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/semgrep.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Name of this GitHub Actions workflow.
2+
name: Semgrep
3+
on:
4+
# Scan changed files in PRs (diff-aware scanning):
5+
pull_request: {}
6+
# Scan on-demand through GitHub Actions interface:
7+
workflow_dispatch: {}
8+
# Scan mainline branches if there are changes to .github/workflows/semgrep.yml:
9+
push:
10+
branches:
11+
- main
12+
- semgrep_integration
13+
paths:
14+
- .github/workflows/semgrep.yml
15+
# Schedule the CI job (this method uses cron syntax):
16+
schedule:
17+
- cron: '20 17 * * *' # Sets Semgrep to scan every day at 17:20 UTC.
18+
# It is recommended to change the schedule to a random time.
19+
jobs:
20+
semgrep:
21+
# User definable name of this GitHub Actions job.
22+
name: semgrep/ci
23+
# If you are self-hosting, change the following `runs-on` value:
24+
runs-on: ubuntu-latest
25+
container:
26+
# A Docker image with Semgrep installed. Do not change this.
27+
image: semgrep/semgrep
28+
# Skip any PR created by dependabot to avoid permission issues:
29+
if: (github.actor != 'dependabot[bot]')
30+
steps:
31+
# Fetch project source with GitHub Actions Checkout. Use either v3 or v4.
32+
- uses: actions/checkout@v4
33+
# Run the "semgrep ci" command on the command line of the docker image.
34+
- run: semgrep ci
35+
env:
36+
# Connect to Semgrep AppSec Platform through your SEMGREP_APP_TOKEN.
37+
# Generate a token from Semgrep AppSec Platform > Settings
38+
# and add it to your GitHub secrets.
39+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}

0 commit comments

Comments
 (0)