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:
parent
78f8e08bb9
commit
64d6f80267
|
|
@ -1,6 +1,12 @@
|
||||||
name: Qodana
|
name: Qodana
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
target_ref:
|
||||||
|
description: 'Branch, tag, or commit SHA to analyze (default: develop)'
|
||||||
|
required: false
|
||||||
|
default: 'develop'
|
||||||
|
type: string
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches: # Specify your branches here
|
branches: # Specify your branches here
|
||||||
|
|
@ -25,9 +31,17 @@ jobs:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0 # a full history is required for pull request analysis
|
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
|
# Checkout for manual runs: use the selected branch/ref (default: develop)
|
||||||
- name: Checkout (push/other)
|
- name: Checkout (workflow_dispatch)
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
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
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue