Skip to content

Commit 99425a8

Browse files
maipbuiyxieca
authored andcommitted
[actions] Support Semgrep by Github Actions (#2417)
Signed-off-by: maipbui <[email protected]> #### Why I did it [Semgrep](https://github.com/returntocorp/semgrep) is a static analysis tool to find security vulnerabilities. When opening a PR or commtting to PR, Semgrep performs a diff-aware scanning, which scans changed files in PRs. When merging PR, Semgrep performs a full scan on master branch and report all findings. Ref: - [Supported Language](https://semgrep.dev/docs/supported-languages/#language-maturity) - [Semgrep Rules](https://registry.semgrep.dev/rule) #### How I did it Integrate Semgrep into this repository by committing a job configuration file #### How to verify it PR: maipbui/sonic-buildimage#2 Master branch full scan findings: [Master branch findings results](https://github.com/maipbui/sonic-buildimage/actions/runs/3160181876/jobs/5144332404) PR maipbui/sonic-buildimage#2 scan findings: [Pull request findings results](https://github.com/maipbui/sonic-buildimage/actions/runs/3160193505/jobs/5144357859)
1 parent f41e4d1 commit 99425a8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/semgrep.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Semgrep
2+
3+
on:
4+
pull_request: {}
5+
push:
6+
branches:
7+
- master
8+
- '201[7-9][0-1][0-9]'
9+
- '202[0-9][0-1][0-9]'
10+
11+
jobs:
12+
semgrep:
13+
name: Semgrep
14+
runs-on: ubuntu-latest
15+
container:
16+
image: returntocorp/semgrep
17+
steps:
18+
- uses: actions/checkout@v3
19+
- run: semgrep ci
20+
env:
21+
SEMGREP_RULES: p/default

0 commit comments

Comments
 (0)