From 64d6f802673027c71b314490f620f5d425738c89 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Sat, 29 Nov 2025 03:59:36 -0300 Subject: [PATCH] Update Qodana workflow: add target_ref input for workflow_dispatch runs - Introduced `target_ref` input to allow specifying a branch, tag, or commit SHA for analysis. - Adjusted checkout logic to support `workflow_dispatch`, `push`, and `pull_request` events separately. --- .github/workflows/qodana_code_quality.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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