Skip to content
Open
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
42 changes: 42 additions & 0 deletions .github/workflows/shiftleft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# This workflow integrates ShiftLeft NG SAST with GitHub
# Visit https://docs.shiftleft.io for help
# a second try
name: ShiftLeft

on:
pull_request:

jobs:
NextGen-Static-Analyis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# We are building this application with Java 11
- name: Setup Java JDK
uses: actions/setup-java@v1.3.0
with:
java-version: 11.0.x
- name: Package with maven
run: mvn compile package
- name: Download ShiftLeft CLI
run: |
curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl
# ShiftLeft requires Java 1.8. Post the package step override the version
- name: Setup Java JDK
uses: actions/setup-java@v1.3.0
with:
java-version: 1.8
- name: NextGen Static Analysis
run: ${GITHUB_WORKSPACE}/sl analyze --app shiftleft-java-demo --tag branch=${{ github.head_ref }} --java --cpg target/hello-shiftleft-0.0.1.jar
env:
SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }}
SHIFTLEFT_API_HOST: www-ext.stg.shiftleft.io
SHIFTLEFT_GRPC_API_HOST: api-ext.stg.shiftleft.io:443
- name: Create status check
run: |
URL="https://www.stg.shiftleft.io/violationlist/shiftleft-java-demo?apps=shiftleft-java-demo&isApp=1"
GH_CHECK_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/check-runs"
curl -XPOST $GH_CHECK_URL -H "Authorization: Token ${GITHUB_TOKEN}" -H "accept: application/vnd.github.antiope-preview+json" -H "Content-Type: application/json" -d "{\"name\": \"ShiftLeft Inspect\", \"head_sha\": \"${GITHUB_REF}\", \"external_id\": \"shiftleft-java-demo\", \"details_url\": \"${URL}\", \"status\": \"completed\", \"conclusion\": \"action_required\", \"output\": {\"title\": \"ShiftLeft Inspect Findings\", \"summary\": \"Visit ${URL} for the findings\"}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}