Skip to content

Commit fe9ebf2

Browse files
ci: add Semgrep OSS scanning workflow
1 parent b7bc038 commit fe9ebf2

1 file changed

Lines changed: 23 additions & 16 deletions

File tree

.github/workflows/semgrep.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1+
name: Semgrep OSS scan
12
on:
23
pull_request: {}
3-
workflow_dispatch: {}
44
push:
5-
branches:
6-
- trunk
5+
branches: [main, master]
6+
workflow_dispatch: {}
77
schedule:
8-
- cron: "0 0 * * *"
9-
name: Semgrep config
8+
- cron: '0 0 20 * *'
9+
concurrency:
10+
group: semgrep-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
permissions:
13+
contents: read
1014
jobs:
1115
semgrep:
12-
name: semgrep/ci
13-
runs-on: ubuntu-latest
14-
env:
15-
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
16-
SEMGREP_URL: https://cloudflare.semgrep.dev
17-
SEMGREP_APP_URL: https://cloudflare.semgrep.dev
18-
SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version
19-
container:
20-
image: semgrep/semgrep
16+
name: semgrep-oss
17+
runs-on: ubuntu-slim
2118
steps:
22-
- uses: actions/checkout@v4
23-
- run: semgrep ci
19+
- uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 1
22+
- id: cache-semgrep
23+
uses: actions/cache@v5
24+
with:
25+
path: ~/.local
26+
key: semgrep-1.160.0-${{ runner.os }}
27+
- if: steps.cache-semgrep.outputs.cache-hit != 'true'
28+
run: pip install --user semgrep==1.160.0
29+
- run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
30+
- run: semgrep scan --config=auto

0 commit comments

Comments
 (0)