-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 935 Bytes
/
semgrep.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Semgrep
on: [ pull_request ]
jobs:
semgrep:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Semgrep
run: pipx install semgrep
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files_ignore: |
**/tests/**
**/conftest.py
- name: Run Semgrep on changed files
if: steps.changed-files.outputs.any_changed == 'true'
run: |
semgrep scan \
--config auto \
--json \
${{ steps.changed-files.outputs.all_changed_files }} \
> results.json
- name: Parse Semgrep results and create annotations
if: steps.changed-files.outputs.any_changed == 'true'
run: python .github/scripts/parse_semgrep.py results.json --fail-on ERROR