Skip to content

Commit c6c87bb

Browse files
authored
Merge pull request #2 from kekoarea/kekoarea-patch-1
Create shiftleft-scan.yml
2 parents 0a3d1b4 + 208ccb2 commit c6c87bb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow integrates ShiftLeft NG SAST with GitHub
2+
# Visit https://docs.shiftleft.io for help
3+
name: ShiftLeft
4+
5+
on:
6+
pull_request:
7+
workflow_dispatch:
8+
push:
9+
# We recommend triggering a scan when merging to your default branch
10+
# as a best practice, especially if you'd like to compare the results
11+
# of two scans (e.g., a feature branch against the default branch)
12+
branches:
13+
- main
14+
- master
15+
jobs:
16+
ngsast-build:
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Download the ShiftLeft CLI and set permissions
22+
run: |
23+
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl
24+
25+
# ShiftLeft requires Java 1.8
26+
- name: Set up Java
27+
uses: actions/[email protected]
28+
with:
29+
java-version: 1.8
30+
31+
- name: Package with Maven
32+
run: mvn clean package
33+
34+
- name: NextGen Static Analysis
35+
run: ${GITHUB_WORKSPACE}/sl analyze --app ShiftLeftJava --tag branch=${{ github.head_ref || steps.extract_branch.outputs.branch }} --vcs-prefix-correction "io/shiftleft=src/main/java/" --java $(pwd)/target/yourJarFileName.jar
36+
37+
env:
38+
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}

0 commit comments

Comments
 (0)