Skip to content

Add Qodana to GitHub Actions #4

Add Qodana to GitHub Actions

Add Qodana to GitHub Actions #4

name: Check-changed-files
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
actions: read
jobs:
qodana:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event.pull_request.commits }}
- name: Get two more commits so Qodana we can identify the changes
if: github.event_name == 'pull_request'
run: git fetch --deepen=2
- name: Run Qodana inspection
uses: JetBrains/qodana-action@v2024.3.4
with:
upload-result: true
args: >
--baseline,doc/qodana-baseline.sarif.json,
--config,.qodana/qodana.yaml
# This step uploads the SARIF file to GitHub so that the code scanning feature can use it.
# https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github#example-workflow-that-runs-the-eslint-analysis-tool
- name: Upload SARIF report to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json