Create scan.yaml #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build-and-analyze: | |
name: Test and Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: temurin | |
cache: 'maven' | |
- name: Build and Run Contrast Scan | |
run: ./mvnw --batch-mode verify | |
env: | |
CONTRAST__API__API_KEY: ${{ secrets.CONTRAST__API__API_KEY }} | |
CONTRAST__API__SERVICE_KEY: ${{ secrets.CONTRAST__API__SERVICE_KEY }} | |
CONTRAST__API__URL: ${{ secrets.CONTRAST__API__URL }} | |
CONTRAST__API__USER_NAME: ${{ secrets.CONTRAST__API__USER_NAME }} | |
CONTRAST__API__ORGANIZATION_ID: ${{ secrets.CONTRAST__API__ORGANIZATION_ID }} | |
- name: Upload Contrast Scan Results | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: target/contrast-scan-reports/contrast-scan-results.sarif.json |