Skip to content

Commit b22b79c

Browse files
Create qwiet.yml
1 parent cab74a4 commit b22b79c

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/qwiet.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 --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 }}

0 commit comments

Comments
 (0)