-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Add report list as parameter #14
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 }} |
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 &&\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without it, we run the second action even if the first failed. Which shouldn't happen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, cool 👍 |
||
bash <(curl -Ls https://coverage.codacy.com/get.sh) final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a real yaml list instead a comma separated string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't unfortunately. Github actions doesn't support it yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.community/t5/GitHub-Actions/Can-action-inputs-be-arrays/td-p/33776
actions/toolkit#184