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.
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda 2025-11-29 03:59:36 -03:00
parent 78f8e08bb9
commit 64d6f80267
1 changed files with 17 additions and 3 deletions

View File

@ -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