Skip to content

Commit 7f6a92e

Browse files
committed
Support more artifacts to restore
1 parent 43d0a5b commit 7f6a92e

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This action scans a java maven project with SonarQube. Features:
1313
- `sonar-host-url` *(Default to https://sonarcloud.io)*: Tells the scanner where SonarQube is hosted
1414
- `working-directory` *(Default to root directory)*: The name of the working directory from which the scan is executed
1515
- `java-version` *(Default 17)*: Java version used run the scans (JDK 17 is the minium required by SonarCloud)
16-
- `restore-artifact-name<N>`, Where `<N>` is a number (1 to 4). Optional name of an artifact to be restored to send additional info to SonarQube (e.g. coverage reports)
16+
- `restore-artifact-name<N>`, Where `<N>` is a number (1 to 6). Optional name of an artifact to be restored to send additional info to SonarQube (e.g. coverage reports)
1717
- `restore-artifact-path<N>` *(Default to the `working-directory`)*: Path where `restore-artifact-name<N>` will be restored (relative to the working directory)'
1818

1919
## Example usage

action.yml

+28
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,22 @@ inputs:
6161
description: 'Path where `restore-artifact-name4` will be restored (relative to the working directory)'
6262
required: false
6363
default: "."
64+
restore-artifact-name5:
65+
description: 'Optional name of an a third artifact to be restored to send additional info to SonarQube'
66+
required: false
67+
default: ""
68+
restore-artifact-path5:
69+
description: 'Path where `restore-artifact-name5` will be restored (relative to the working directory)'
70+
required: false
71+
default: "."
72+
restore-artifact-name6:
73+
description: 'Optional name of an a fourth artifact to be restored to send additional info to SonarQube'
74+
required: false
75+
default: ""
76+
restore-artifact-path6:
77+
description: 'Path where `restore-artifact-name6` will be restored (relative to the working directory)'
78+
required: false
79+
default: "."
6480

6581
runs:
6682
using: "composite"
@@ -120,6 +136,18 @@ runs:
120136
with:
121137
name: ${{ inputs.restore-artifact-name4 }}
122138
path: ${{ inputs.working-directory }}/${{ inputs.restore-artifact-path4 }}
139+
- name: Restore test reports
140+
if: inputs.restore-artifact-name5 != ''
141+
uses: actions/[email protected]
142+
with:
143+
name: ${{ inputs.restore-artifact-name5 }}
144+
path: ${{ inputs.working-directory }}/${{ inputs.restore-artifact-path5 }}
145+
- name: Restore test reports
146+
if: inputs.restore-artifact-name6 != ''
147+
uses: actions/[email protected]
148+
with:
149+
name: ${{ inputs.restore-artifact-name6 }}
150+
path: ${{ inputs.working-directory }}/${{ inputs.restore-artifact-path6 }}
123151

124152
# Manual exeuction, maven plugin does not read sonar-project.properties nor .sonarcloud.properties
125153
# Keeps independent from the pom.xml

0 commit comments

Comments
 (0)