name: Qodana on: workflow_dispatch: inputs: target_ref: description: 'Branch, tag, or commit SHA to analyze (default: develop)' required: false default: 'develop' type: string pull_request: push: branches: # Specify your branches here - master - main # The 'main' branch - develop - 'releases/*' # The release branches jobs: qodana: runs-on: ubuntu-latest permissions: contents: write pull-requests: write checks: write steps: # Checkout for pull_request events: use the PR head SHA for accurate analysis - name: Checkout (pull_request) if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 # a full history is required for pull request analysis # Checkout for manual runs: use the selected branch/ref (default: develop) - name: Checkout (workflow_dispatch) if: ${{ github.event_name == 'workflow_dispatch' }} uses: actions/checkout@v4 with: ref: ${{ inputs.target_ref }} fetch-depth: 0 # Checkout for push events (e.g., merges to develop): use the current commit - name: Checkout (push) if: ${{ github.event_name == 'push' }} uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2025.2 with: # Enable PR-specific reporting only for pull_request events pr-mode: ${{ github.event_name == 'pull_request' }} # No extra args needed; linter is defined in qodana.yaml (qodana-jvm) env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_268690425 }} QODANA_ENDPOINT: 'https://qodana.cloud'