File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ # This workflow integrates ShiftLeft NG SAST with GitHub
3+ # Visit https://docs.shiftleft.io for help
4+ name : ShiftLeft
5+
6+ on :
7+ push :
8+ branches :
9+ - main
10+ - master
11+ pull_request :
12+ workflow_dispatch :
13+
14+ jobs :
15+ NextGen-Static-Analyis :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v2
19+ # We are building this application with Java 11
20+ - name : Setup Java JDK
21+ 22+ with :
23+ java-version : 11.0.x
24+ - name : Build and package with Maven
25+ run : mvn clean package -DskipTests
26+ - name : Download ShiftLeft CLI
27+ run : |
28+ curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl
29+ # ShiftLeft requires Java 1.8. Post the package step override the version
30+ - name : Setup Java JDK
31+ 32+ with :
33+ java-version : 1.8
34+ - name : Extract branch name
35+ shell : bash
36+ run : echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
37+ id : extract_branch
38+ - name : NextGen Static Analysis
39+ run : ${GITHUB_WORKSPACE}/sl analyze --wait --app java-sec-code --tag branch=${{ github.head_ref || steps.extract_branch.outputs.branch }} --remediation-config remediation.yaml --vcs-prefix-correction "*=/src/main/java" --java ./target/java-sec-code-1.0.0.jar
40+ env :
41+ SHIFTLEFT_ACCESS_TOKEN : ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
42+
43+ - name : Validate Build Rules
44+ run : |
45+ ${GITHUB_WORKSPACE}/sl check-analysis --v2 --app java-sec-code \
46+ --report \
47+ --github-pr-number=${{github.event.number}} \
48+ --github-pr-user=${{ github.repository_owner }} \
49+ --github-pr-repo=${{ github.event.repository.name }} \
50+ --github-token=${{ secrets.GITHUB_TOKEN }}
51+ env :
52+ SHIFTLEFT_ACCESS_TOKEN : ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
You can’t perform that action at this time.
0 commit comments