diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index 386e601..d926b31 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -1,6 +1,12 @@ 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 @@ -25,9 +31,17 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 # a full history is required for pull request analysis - # Checkout for push and other events (e.g., merges to develop): use the current commit - - name: Checkout (push/other) - if: ${{ github.event_name != 'pull_request' }} + # 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