Skip to content

Commit

Permalink
feat: add explicit codecov token input (#643)
Browse files Browse the repository at this point in the history
* feat: add explicit codecov token input

* feat: set appropriate error message when no codecov token is provided but codecov step enabled

* fix: add bash shell

---------

Co-authored-by: Nicolas Farabegoli <[email protected]>
  • Loading branch information
DanySK and nicolasfara authored Jul 9, 2024
1 parent de5cdfe commit 7dae531
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: 'The location where CodeCov searches for coverage information'
default: build
required: false
codecov-token:
description: 'The codecov token for this repository'
default: ""
required: false
deploy-command:
description: 'The condition triggering a deploy run'
default: "./gradlew publish --parallel"
Expand Down Expand Up @@ -195,11 +199,16 @@ runs:
if [ "$attempt" = "${{ inputs.retries-on-failure}}" ]; then false; fi
done
echo "::endgroup::"
- name: Check codecov token
shell: bash
if: inputs.should-run-codecov == 'true' && inputs.codecov-token == ''
run: echo '::error title=Codecov enabled but no Codecov token provided::Please set the `codecov-token` input with the appropriate Codecov token'
- name: CodeCov
if: inputs.should-run-codecov == 'true'
uses: codecov/[email protected]
with:
directory: ${{ inputs.codecov-directory }}
token: ${{ inputs.codecov-token }}
- name: Deploy
if: inputs.should-deploy == 'true'
working-directory: ${{ inputs.working-directory }}
Expand Down

0 comments on commit 7dae531

Please sign in to comment.