Skip to content

Commit

Permalink
Merge pull request #80 from codacy/add-coverage-reporter-version
Browse files Browse the repository at this point in the history
added flag coverage-reporter-version
  • Loading branch information
DMarinhoCodacy committed Jan 9, 2024
2 parents ff05da9 + 25538fe commit 3c4bf6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codacy-coverage-reporter.yml
Expand Up @@ -12,3 +12,4 @@ jobs:
uses: ./
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reporter-version: 13.13.15
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -68,4 +68,6 @@ The Codacy GitHub Action is a wrapper for running the [Codacy Coverage Reporter
| `api-token` | [Account API token](https://docs.codacy.com/codacy-api/api-tokens/#account-api-tokens), an alternative to `project-token` when setting up multiple repositories | `${{ secrets.CODACY_API_TOKEN }}` |
| `coverage-reports` | Optional path to the coverage report relative to the repository root, or a comma-separated list for multiple reports | `''` |
| `language` | Optionally associate a language with your coverage report(s) | `''` |
| `force-coverage-parser` | Optionally force using a specific coverage report parser | `''` |
| `force-coverage-parser` | Optionally force using a specific coverage report parser | `''` |
| `coverage-reporter-version` | Optionally force using a specific coverage reporter version |
`''`
9 changes: 7 additions & 2 deletions action.yml
Expand Up @@ -21,6 +21,9 @@ inputs:
force-coverage-parser:
description: 'Optionally force using a specific coverage report parser'
required: false
coverage-reporter-version:
description: 'Optionally force using a specific coverage reporter version'
required: false
runs:
using: "composite"
steps:
Expand All @@ -30,6 +33,8 @@ runs:
echo "ORGANIZATION_PROVIDER=$(if [[ $GITHUB_SERVER_URL == "https://github.com" ]]; then echo "gh"; else echo "ghe"; fi)" >> $GITHUB_ENV
echo "OWNER_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1)" >> $GITHUB_ENV
echo "REPOSITORY_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)" >> $GITHUB_ENV
echo "CODACY_REPORTER_VERSION=$(if [ -n "${{ inputs.coverage-reporter-version }}" ]; then echo "${{ inputs.coverage-reporter-version }}"; fi)" >> $GITHUB_ENV
- name: "Run coverage-reporter"
shell: bash
run: |
Expand All @@ -56,5 +61,5 @@ runs:
if [ -n "${{ inputs.force-coverage-parser }}" ]; then force_parser="--force-coverage-parser ${{ inputs.force-coverage-parser }}"; else force_parser=""; fi
if [ -n "${{ inputs.language }}" ]; then lang="--language ${{ inputs.language }}"; else lang=""; fi
bash <(curl -Ls https://raw.githubusercontent.com/codacy/codacy-coverage-reporter/master/get.sh) report $lang $force_parser $auth $params --partial &&\
bash <(curl -Ls https://raw.githubusercontent.com/codacy/codacy-coverage-reporter/master/get.sh) final $auth
bash <(curl -Ls https://coverage.codacy.com/get.sh) report $lang $force_parser $auth $params --partial &&\
bash <(curl -Ls https://coverage.codacy.com/get.sh) final $auth

0 comments on commit 3c4bf6f

Please sign in to comment.