-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add report list as parameter (#14)
- Loading branch information
Francisco Duarte
committed
May 5, 2020
1 parent
ba0bf05
commit 4f8ea68
Showing
3 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
# action.yml | ||
name: "Codacy Coverage Reporter" | ||
description: "Multi-language coverage reporter for Codacy" | ||
name: 'Codacy Coverage Reporter' | ||
description: 'Multi-language coverage reporter for Codacy' | ||
branding: | ||
icon: 'check' | ||
color: 'gray-dark' | ||
inputs: | ||
project-token: | ||
description: 'Project token for the Codacy project you want to send coverage information' | ||
required: true | ||
coverage-reports: | ||
description: 'Optional comma separated list of coverage reports to send to Codacy' | ||
required: false | ||
default: '' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- "${{ inputs.project-token }}" | ||
- ${{ inputs.project-token }} | ||
- ${{ inputs.coverage-reports }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
#!/bin/bash | ||
|
||
export CODACY_PROJECT_TOKEN=$1 | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) | ||
# comma separated list of report files | ||
report_list=$2 | ||
|
||
IFS=',' | ||
report_array=$report_list | ||
params='' | ||
for report in $report_array | ||
do | ||
if [ ! -z "$report" ] | ||
then | ||
params="$params -r $report" | ||
fi | ||
done | ||
|
||
bash <(curl -Ls https://coverage.codacy.com/get.sh) report $params --partial &&\ | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) final |