Skip to content

Commit 3b8259b

Browse files
committed
Supports up to four artifacts to restore
1 parent 9c8b8ae commit 3b8259b

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 11)*: Java version used run the scans (JDK 11 is the minium required)
16-
- `restore-artifact-name<N>`, Where `<N>` is a number (1 or 2). 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 4). 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
@@ -41,6 +41,22 @@ inputs:
4141
description: 'Path where `restore-artifact-name2` will be restored (relative to the working directory)'
4242
required: false
4343
default: "."
44+
restore-artifact-name3:
45+
description: 'Optional name of an a third artifact to be restored to send additional info to SonarQube'
46+
required: false
47+
default: ""
48+
restore-artifact-path3:
49+
description: 'Path where `restore-artifact-name3` will be restored (relative to the working directory)'
50+
required: false
51+
default: "."
52+
restore-artifact-name4:
53+
description: 'Optional name of an a fourth artifact to be restored to send additional info to SonarQube'
54+
required: false
55+
default: ""
56+
restore-artifact-path4:
57+
description: 'Path where `restore-artifact-name4` will be restored (relative to the working directory)'
58+
required: false
59+
default: "."
4460

4561
runs:
4662
using: "composite"
@@ -86,6 +102,18 @@ runs:
86102
with:
87103
name: ${{ inputs.restore-artifact-name2 }}
88104
path: ${{ inputs.working-directory }}/${{ inputs.restore-artifact-path2 }}
105+
- name: Restore test reports
106+
if: inputs.restore-artifact-name3 != ''
107+
uses: actions/download-artifact@v3
108+
with:
109+
name: ${{ inputs.restore-artifact-name3 }}
110+
path: ${{ inputs.working-directory }}/${{ inputs.restore-artifact-path3 }}
111+
- name: Restore test reports
112+
if: inputs.restore-artifact-name4 != ''
113+
uses: actions/download-artifact@v3
114+
with:
115+
name: ${{ inputs.restore-artifact-name4 }}
116+
path: ${{ inputs.working-directory }}/${{ inputs.restore-artifact-path4 }}
89117

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

0 commit comments

Comments
 (0)