Skip to content

Commit 3ef126b

Browse files
authored
Create main.yml
1 parent 3d237d6 commit 3ef126b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
uses: actions/[email protected]
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+
uses: actions/[email protected]
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-test --tag branch=${{ github.head_ref || steps.extract_branch.outputs.branch }} --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+

0 commit comments

Comments
 (0)