diff --git a/.github/workflows/shiftleft.yml b/.github/workflows/shiftleft.yml new file mode 100644 index 00000000..4870c3a8 --- /dev/null +++ b/.github/workflows/shiftleft.yml @@ -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/setup-java@v1.4.3 + 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 }} diff --git a/README.md b/README.md index edfda09c..a6d7588e 100644 --- a/README.md +++ b/README.md @@ -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`. +# Modifying project