From 0804dc4c833ed147ed56a20805a1bccbd721b49a Mon Sep 17 00:00:00 2001 From: David Marinho Date: Mon, 8 Jan 2024 18:36:11 +0000 Subject: [PATCH 1/2] added flag coverage-reporter-version --- README.md | 4 +++- action.yml | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d62b0ef..7d24b51 100755 --- a/README.md +++ b/README.md @@ -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 | `''` | \ No newline at end of file +| `force-coverage-parser` | Optionally force using a specific coverage report parser | `''` | +| `coverage-reporter-version` | Optionally force using a specific coverage reporter version | +`''` diff --git a/action.yml b/action.yml index 4e2ee2d..cf96452 100755 --- a/action.yml +++ b/action.yml @@ -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: @@ -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: | @@ -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 From 25538fee4a488f9964246ad152b620155a39d62a Mon Sep 17 00:00:00 2001 From: David Marinho Date: Mon, 8 Jan 2024 18:39:14 +0000 Subject: [PATCH 2/2] fix workflow test coverage --- .github/workflows/codacy-coverage-reporter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codacy-coverage-reporter.yml b/.github/workflows/codacy-coverage-reporter.yml index 8532c86..91eec9f 100644 --- a/.github/workflows/codacy-coverage-reporter.yml +++ b/.github/workflows/codacy-coverage-reporter.yml @@ -12,3 +12,4 @@ jobs: uses: ./ with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reporter-version: 13.13.15