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

  1. After retrieving the token above, navigate to Settings for your repository on GitHub. Find the Secrets and Variables tab in the sidebar and click Actions

  2. Add the token as a New repository secret. Note that the Secret field should not include CODECOV_TOKEN=

  3. 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

  1. After retrieving the token above, navigate to Project Settings for your repository on CircleCI. Find the Environment Variables tab in the sidebar.

  1. Add the token as a Add Environment Variable. Note that the Value field should not include CODECOV_TOKEN=

  2. 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