Update codescan.yml #217
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: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Changed Files | |
uses: jitterbit/get-changed-files@v1 | |
id: files | |
with: | |
format: csv | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache files | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sonar | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: SETUP JAVA | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '21' | |
- name: Run Codescan On Push | |
env: | |
JAVA_TOOL_OPTIONS: "-Xmx8g" | |
if: github.event_name == 'push' | |
uses: codescan-io/codescan-scanner-action@1.4 | |
with: | |
organization: 5a81394e5c679b17810e4301 | |
projectKey: actiontest | |
codeScanUrl: https://app.codescan.io/ | |
login: ${{ secrets.CODESCAN_TOKEN }} | |
args: | | |
sonar.projectVersion=new | |
- name: Run Codescan On PR | |
env: | |
JAVA_TOOL_OPTIONS: "-Xmx8g" | |
if: github.event_name == 'pull_request' && steps.files.outputs.added_modified != null | |
uses: codescan-io/codescan-scanner-action@1.4 | |
with: | |
organization: 5a81394e5c679b17810e4301 | |
projectKey: actiontest | |
codeScanUrl: https://app.codescan.io/ | |
login: ${{ secrets.CODESCAN_TOKEN }} | |
pollingTimeoutSec: 900000 | |
generateSarifFile: true | |
args: | | |
sonar.pullrequest.branch=${{github.head_ref}} | |
sonar.pullrequest.base=${{github.base_ref}} | |
sonar.pullrequest.key=${{github.event.number}} | |
sonar.inclusions=${{ steps.files.outputs.added_modified }} | |
- name: Upload SARIF file | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: codescan.sarif | |