Skip to content

Commit 91fea1a

Browse files
committed
Provide way to append args to the begin or end cmds
1 parent 9d6cf34 commit 91fea1a

3 files changed

Lines changed: 15 additions & 27 deletions

File tree

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ _Currently does not support username/password authentication and presumes you ar
1515
projectKey: a-project-key
1616
projectName: a-project-name
1717
sonarOrganisation: an-org
18-
verbose: "true"
19-
openCoverPaths: "tests/coverage.opencover.xml"
20-
coverageExclusions: "**test*.cs"
18+
beginArguments: /d:sonar.verbose="true" /d:sonar.cs.opencover.reportsPaths="/path/to/coverage.xml" /d:sonar.coverage.exclusions="**/*.cs"
2119
env:
2220
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2321
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -45,15 +43,11 @@ sonarHostname:
4543
sonarOrganisation:
4644
description: "Organisation"
4745
required: true
48-
verbose:
49-
default: "false"
50-
description: "Enable verbose logging"
46+
beginArguments:
47+
description: "Arguments to append to the begin command"
5148
required: false
52-
openCoverPaths:
53-
description: "Path(s) to coverage file(s)"
54-
required: false
55-
coverageExclusions:
56-
description: "Glob(s) for files to exclude from coverage"
49+
endArguments:
50+
description: "Arguments to append to the end command"
5751
required: false
5852
```
5953

action.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@ inputs:
2222
sonarOrganisation:
2323
description: "Organisation"
2424
required: true
25-
verbose:
26-
default: "false"
27-
description: "Enable verbose logging"
25+
beginArguments:
26+
description: "Arguments to append to the begin command"
2827
required: false
29-
openCoverPaths:
30-
description: "Path(s) to coverage file(s)"
31-
required: false
32-
coverageExclusions:
33-
description: "Glob(s) for files to exclude from coverage"
28+
endArguments:
29+
description: "Arguments to append to the end command"
3430
required: false
3531

3632
runs:
@@ -43,9 +39,8 @@ runs:
4339
- ${{ inputs.projectName }}
4440
- ${{ inputs.sonarHostname }}
4541
- ${{ inputs.sonarOrganisation }}
46-
- ${{ inputs.verbose }}
47-
- ${{ inputs.openCoverPaths }}
48-
- ${{ inputs.coverageExclusions }}
42+
- ${{ inputs.beginArguments }}
43+
- ${{ inputs.endArguments }}
4944

5045
branding:
5146
icon: 'check'

entrypoint.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
# projectName = $4
77
# sonarHostname = $5
88
# sonarOrganisation = $6
9-
# verbose = $7
10-
# openCoverPaths = $8
11-
# coverageExclusions = $9
9+
# beginArguments = $7
10+
# endArguments = $8
1211

1312
set -eu
1413

@@ -37,12 +36,12 @@ fi
3736

3837
if [ -n "$7" ]
3938
then
40-
begin_cmd="$begin_cmd /d:sonar.verbose=\"$7\""
39+
begin_cmd="$begin_cmd $7"
4140
fi
4241

4342
if [ -n "$8" ]
4443
then
45-
begin_cmd="$begin_cmd /d:sonar.cs.opencover.reportsPaths=\"$8\""
44+
end_cmd="$end_cmd $8"
4645
fi
4746

4847
if [ -n "$9" ]

0 commit comments

Comments
 (0)