Skip to content

Commit 14318da

Browse files
committed
fix(action): FTRS-0006 Update action again to fix
1 parent 83f08b8 commit 14318da

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/actions/perform-static-analysis/action.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ description: "Perform SonarCloud static analysis"
44
inputs:
55
sonar_organisation_key:
66
description: "Sonar organisation key, used to identify the project"
7-
required: false
7+
required: true
88
sonar_project_key:
99
description: "Sonar project key, used to identify the project"
10-
required: false
10+
required: true
1111
sonar_token:
1212
description: "Sonar token, the API key"
13-
required: false
13+
required: true
1414

1515
runs:
1616
using: "composite"
@@ -20,6 +20,7 @@ runs:
2020
with:
2121
path: coverage/
2222
pattern: coverage-*.xml
23+
merge-multiple: true
2324

2425
- name: "Find coverage files"
2526
id: coverage-files
@@ -51,13 +52,13 @@ runs:
5152
ARGS="$ARGS -Dsonar.python.coverage.reportPaths=$COV"
5253
fi
5354
54-
# Explicit PR detection and parameter setting
55-
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ -n "$PR_NUMBER" ]; then
55+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] && [ -n "$PR_NUMBER" ] && [ -n "$PR_HEAD_REF" ] && [ -n "$PR_BASE_REF" ]; then
56+
echo "Configuring for PR analysis"
5657
ARGS="$ARGS -Dsonar.pullrequest.key=$PR_NUMBER"
57-
ARGS="$ARGS -Dsonar.pullrequest.branch=$PR_HEAD_REF"
58+
ARGS="$ARGS -Dsonar.pullrequest.branch=$PR_HEAD_REF"
5859
ARGS="$ARGS -Dsonar.pullrequest.base=$PR_BASE_REF"
5960
else
60-
echo "Configuring for branch analysis: $BRANCH_NAME"
61+
echo "Configuring for branch analysis"
6162
ARGS="$ARGS -Dsonar.branch.name=$BRANCH_NAME"
6263
fi
6364

0 commit comments

Comments
 (0)