Skip to content

Commit

Permalink
Provide way to append args to the begin or end cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaduffy committed Nov 20, 2019
1 parent 9d6cf34 commit 91fea1a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ _Currently does not support username/password authentication and presumes you ar
projectKey: a-project-key
projectName: a-project-name
sonarOrganisation: an-org
verbose: "true"
openCoverPaths: "tests/coverage.opencover.xml"
coverageExclusions: "**test*.cs"
beginArguments: /d:sonar.verbose="true" /d:sonar.cs.opencover.reportsPaths="/path/to/coverage.xml" /d:sonar.coverage.exclusions="**/*.cs"
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -45,15 +43,11 @@ sonarHostname:
sonarOrganisation:
description: "Organisation"
required: true
verbose:
default: "false"
description: "Enable verbose logging"
beginArguments:
description: "Arguments to append to the begin command"
required: false
openCoverPaths:
description: "Path(s) to coverage file(s)"
required: false
coverageExclusions:
description: "Glob(s) for files to exclude from coverage"
endArguments:
description: "Arguments to append to the end command"
required: false
```
Expand Down
17 changes: 6 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@ inputs:
sonarOrganisation:
description: "Organisation"
required: true
verbose:
default: "false"
description: "Enable verbose logging"
beginArguments:
description: "Arguments to append to the begin command"
required: false
openCoverPaths:
description: "Path(s) to coverage file(s)"
required: false
coverageExclusions:
description: "Glob(s) for files to exclude from coverage"
endArguments:
description: "Arguments to append to the end command"
required: false

runs:
Expand All @@ -43,9 +39,8 @@ runs:
- ${{ inputs.projectName }}
- ${{ inputs.sonarHostname }}
- ${{ inputs.sonarOrganisation }}
- ${{ inputs.verbose }}
- ${{ inputs.openCoverPaths }}
- ${{ inputs.coverageExclusions }}
- ${{ inputs.beginArguments }}
- ${{ inputs.endArguments }}

branding:
icon: 'check'
Expand Down
9 changes: 4 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
# projectName = $4
# sonarHostname = $5
# sonarOrganisation = $6
# verbose = $7
# openCoverPaths = $8
# coverageExclusions = $9
# beginArguments = $7
# endArguments = $8

set -eu

Expand Down Expand Up @@ -37,12 +36,12 @@ fi

if [ -n "$7" ]
then
begin_cmd="$begin_cmd /d:sonar.verbose=\"$7\""
begin_cmd="$begin_cmd $7"
fi

if [ -n "$8" ]
then
begin_cmd="$begin_cmd /d:sonar.cs.opencover.reportsPaths=\"$8\""
end_cmd="$end_cmd $8"
fi

if [ -n "$9" ]
Expand Down

0 comments on commit 91fea1a

Please sign in to comment.