Adding the Codecov token
The Codecov token must be provided to the Codecov CLI in order to upload coverage reports. This token can be found in the configuration tab of your repository in Codecov, under General.
Below are some instructions on how to do incorporate the above token into some common setups.
GitHub Actions
-
After retrieving the token above, navigate to
Settings
for your repository on GitHub. Find theSecrets and Variables
tab in the sidebar and clickActions
-
Add the token as a
New repository secret
. Note that theSecret
field should not includeCODECOV_TOKEN=
-
Save the secret and update your CI workflow. If you are using the Codecov Action, you can use a setup similar to below. The Codecov step should now properly intake the token.
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CircleCI
- After retrieving the token above, navigate to
Project Settings
for your repository on CircleCI. Find theEnvironment Variables
tab in the sidebar.
-
Add the token as a
Add Environment Variable
. Note that theValue
field should not includeCODECOV_TOKEN=
-
Save the variable and update your CI workflow. If you are using the Codecov CircleCI Orb, the Orb will automatically pick up the token if it is named
CODECOV_TOKEN
. The Codecov step should now properly intake the token
Updated 5 months ago