Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/shiftleft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow integrates ShiftLeft NG SAST with GitHub
# Visit https://docs.shiftleft.io for help
name: ShiftLeft

on:
pull_request:
workflow_dispatch:
push:
# We recommend triggering a scan when merging to your default branch
# as a best practice, especially if you'd like to compare the results
# of two scans (e.g., a feature branch against the default branch)
branches:
- main
- master
jobs:
ngsast-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Download the ShiftLeft CLI and set permissions
run: |
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl

# ShiftLeft requires Java 1.8
- name: Set up Java
uses: actions/[email protected]
with:
java-version: 1.8

- name: Package with Maven
run: mvn clean package

- name: NextGen Static Analysis
run: ${GITHUB_WORKSPACE}/sl analyze --app java-sec-code --tag branch=${{ github.head_ref || steps.extract_branch.outputs.branch }} --vcs-prefix-correction "io/shiftleft=src/main/java/" --java $(pwd)/target/java-sec-code-1.0.0.jar

env:
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,4 @@ If you like the poject, you can donate to support me. With your support, I will
Scan the QRcode to support `Java sec code`.

<img title="Alipay QRcode" src="https://aliyun-testaaa.oss-cn-shanghai.aliyuncs.com/alipay_qr.png" width="200">
# Modifying project