-
Notifications
You must be signed in to change notification settings - Fork 233
test-coverage action is not up to date with codecov authentification policy and should already include CODECOV_TOKEN #822
Description
Hi guys ! Thanks for the package. Just discovered this yesterday.
Describe the bug
test-coverage action is not up to date with codecov default authentication procedure.
For coverage results to be uploaded to codecov.io by covr::codecov() a code cov token needs to be available in the environment.
For example as a CODECOV_TOKEN secret.
To Reproduce
On a package repo :
usethis::use_tidy_package()
# Add some functions and tests
usethis::use_coverage()
devtools::build_readme()
usethis::use_github_action("test-coverage")Then push or make a PR to main or master
The test coverage job will succeed but your coverage badge will remain gray with an "Unknown" mention.
See this workflow
in order for the code coverage to be uploaded to codecov.
You need to click on the badge. You are then provided with a token.
This token should be included in a repository secret and defined in the env statement of the workflow as such:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}See this commit
Once that done,
The coverage result was properly uploaded to codecov.io
See the corresponding workflow
Expected behavior
The env statement of the action test-coverage should already contained the following lines
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}and users should be notified on why and how to set this CODECOV_TOKEN as a repository secret.
Additional context
covr::codecov() should not failed silently. I will also open an issue in {covr}.
In my different trials I came to realize that the GITHUB_PAT defined in the workflow was not of any use.
The workflow runs successfully without it.
See this (commit)[https://github.com/ALanguillaume/test.cd.pkgdown.gh/commit/6ff28e63f8c5e35a67e96e1d7f44927bb5ceb178] and workflow

