forked from kedacore/keda
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.08 KB
/
static-analysis-semgrep.yml
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
34
35
36
37
name: "Semgrep"
on:
push:
branches: [ "main" ]
pull_request_target: {}
jobs:
semgrep:
name: Analyze Semgrep
runs-on: ubuntu-latest
container: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Register workspace path
if: ${{ github.event.number > 0 }}
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: checkout
if: ${{ github.event.number > 0 }}
run: |
apk add github-cli
gh pr checkout ${{ github.event.number }}
- run: semgrep ci --sarif --output=semgrep.sarif
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: semgrep.sarif
if: ${{ github.event.number == '' && !cancelled() }}