Skip to content

Commit

Permalink
feat: build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 5, 2020
1 parent 6740b5d commit 53ebfe1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
10 changes: 6 additions & 4 deletions README.md
Expand Up @@ -22,15 +22,17 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Run codacy-coverage-reporter
uses: mrfyda/codacy-coverage-reporter-action@master
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: cobertura.xml
```

## Workflow options

Change these options in the workflow `.yml` file to meet your GitHub project needs.

| Setting | Description | Default value |
| --------------- | ----------------------------------- | ------------------------------------- |
| `project-token` | The project API token | `${{ secrets.CODACY_PROJECT_TOKEN }}` |
| Setting | Description | Default value |
| ------------------ | ------------------------------------------------ | ------------------------------------- |
| `project-token` | The project API token | `${{ secrets.CODACY_PROJECT_TOKEN }}` |
| `coverage-reports` | Optional Comma separated list of reports to send | `''` |
12 changes: 9 additions & 3 deletions action.yml
@@ -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 }}
17 changes: 16 additions & 1 deletion entrypoint.sh
@@ -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

0 comments on commit 53ebfe1

Please sign in to comment.