@@ -8,8 +8,8 @@ permissions:
88
99jobs :
1010 semgrep :
11- # Skip any PR created by dependabot to avoid permission issues:
12- if : (github.actor != 'dependabot[bot]')
11+ # # Skip any PR created by dependabot to avoid permission issues:
12+ # if: (github.actor != 'dependabot[bot]')
1313 name : semgrep-oss/scan
1414 runs-on : ubuntu-latest
1515 permissions :
2424 - uses : actions/checkout@v3
2525 with :
2626 fetch-depth : 0
27- - run : |
28- git clone https://github.com/trailofbits/semgrep-rules $HOME/semgrep-rules-tob
29- git clone https://github.com/semgrep/semgrep-rules $HOME/semgrep-rules
30- git -C $HOME/semgrep-rules reset --hard 518f71b883d431fa33268844b066033507e7c1b5
31- git -C $HOME/semgrep-rules-tob reset --hard 3b91c9b622b4a250b144a832ce73091b1f25e207
32- rm $HOME/semgrep-rules-tob/.github/workflows/update-semgrep-registry.yml
33- rm $HOME/semgrep-rules/.pre-commit-config.yaml
34- rm -rf $HOME/semgrep-rules-tob/.github
35- rm -rf $HOME/semgrep-rules/.github
36- rm -rf $HOME/semgrep-rules/stats
37- - run : git config --global --add safe.directory $(pwd)
38- - run : |
39- semgrep scan --config $HOME/semgrep-rules --config $HOME/semgrep-rules-tob \
40- --metrics=off --experimental \
41- --exclude-rule=third-party-action-not-pinned-to-commit-sha \
42- --exclude-rule=jsx-not-internationalized \
43- --severity=WARNING \
44- --severity=ERROR \
45- --exclude="*.html" --exclude="*.js" \
46- --baseline-commit=${{ github.event.pull_request.base.sha }} \
47- --json > /tmp/semgrep-results.json || true
48- - run : /usr/bin/jq --version
49- - name : Notice
50- shell : bash
51- run : |
52- /usr/bin/jq -r '.results[]
53- | . + {
54- severity: (
55- if .extra.severity == "WARNING" then "warning"
56- elif .extra.severity == "ERROR" then "error"
57- else "notice"
58- end
59- )
60- }
61- | "::\(.severity) file=\(.path),line=\(.start.line),col=\(.start.col),endLine=\(.end.line),endColumn=\(.end.col),title=\(.check_id)::\((.extra.message
62- | gsub("[^a-zA-Z0-9 .]"; "")
63- ))"' /tmp/semgrep-results.json
64- # - name: Upload SARIF file
65- # uses: github/codeql-action/upload-sarif@v2
66- # with:
67- # # Path to SARIF file relative to the root of the repository
68- # sarif_file: /tmp/semgrep-results.sarif
69- # if: always()
27+ persist-credentials : false
28+ - uses : ./.github/actions/semgrep-action
7029
0 commit comments