added properties #6
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: CxOne Scan -> Sonar | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
scan: | |
name: Run CxAST cli | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Checkmarx AST CLI Action | |
uses: checkmarx/ast-github-action@main | |
with: | |
base_uri: ${{ secrets.BASE_URI }} | |
cx_tenant: ${{ secrets.TENANT }} | |
cx_client_id: ${{ secrets.AST_CLIENT_ID }} | |
cx_client_secret: ${{ secrets.AST_CLIENT_SECRET }} | |
additional_params: --report-format sonar --output-path . --scan-types sast --tags ${{ github.event.pull_request.head.sha }},${{ github.sha }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'zulu' # Alternative distribution options are available. | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Build and analyze | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.externalIssuesReportPaths=cx_result_sonar.json -Dsonar.host.url=SONAR_HOST_URL -Dsonar.projectKey=jvlstuff_JavaVulnerableLab_for_AST_GH_actions -Dsonar.organization=jvlstuff |