About the Codecov yaml

Codecov uses a Yaml-style configuration methodology.

There are two primary locations for the Codecov Yaml: the Team Yaml and the Repository Yaml. Each of them play an important role in how to configure Codecov.


Looking for all possible YAML configurations?

See the full codecov.yml Reference page.

Default yaml

The default configuration for all projects in Codecov is demonstrated below. You may override any of these configurations in your own Team/Repository Yaml.

  require_ci_to_pass: yes

  precision: 2
  round: down
  range: "70...100"

      conditional: yes
      loop: yes
      method: no
      macro: no

  layout: "reach,diff,flags,files,footer"
  behavior: default
  require_changes: no


Just starting out?

If no changes are made to the default YAML, Codecov will use the above.

Therefore, it is not necessary to copy and paste the above to start your use of Codecov. In most cases, Codecov will work without the need for a codecov.yml file.

Team yaml

Codecov provides a user interface to adjust a "team yaml", which overrides the default settings in Codecov. It is applied to all repositories in the team. Only team administrators can adjust the team yaml in Codecov. All changes are stored in history.

The most common use for the team yaml is to set up a Codecov Bot account and adding custom CI services.

The team yaml (seen in the black box above) can be found in your account center `/account/gh/OWNER/yaml`.The team yaml (seen in the black box above) can be found in your account center `/account/gh/OWNER/yaml`.

The team yaml (seen in the black box above) can be found in your account center /account/gh/OWNER/yaml.

Repository yaml

Each repository may have their own unique Codecov Yaml. The contents of the Repository Yaml are stored in a file, checked into git/hg.

`codecov.yml` in the project root.`codecov.yml` in the project root.

codecov.yml in the project root.

All configurations in the Repository Yaml will override the Team Yaml. The Team Yaml is not replaced, but updated with the Repository Yaml.

# Team Yaml
  round: down
  precision: 5

# Repository Yaml
  round: up
  range: 0..10

# Used in Codecov after updating
  round: up
  range: 0..10
  precision: 5


Looking to pass or fail a pull request / merge request based on coverage?

Please see our "Commit Status" feature for passing or failing a pull request based on code coverage thresholds

Validate your repository yaml

Validate your repository yaml by posting the content to Codecov for analysis.

curl --data-binary @codecov.yml https://codecov.io/validate
# PowerShell Sample
Invoke-RestMethod -Uri https://codecov.io/validate -Body (Get-Content -Raw -LiteralPath .\codecov.yml) -Method post


Validation response codes.

A quick way to determine if the YAML validated against this endpoint is to check the response code. An invalid YAML will return a status code of 400, instead of the normal 200 success.

Master copy

Codecov will use the default branch for your repository as the "master" copy of the repositories Codecov Yaml. The default branch, if not otherwise stated, is the master branch. You can change the Codecov default branch in your Yaml.

  branch: stable

The default branch is used to identify:

  1. Which branch to cache the repository yaml for UI changes.
  2. Which branch is the first branch on the repository dashboard in Codecov.

Restricting changes

Codecov will always use the current yaml on the branch being tested by default. If you would like to restrict changes to the yaml, and always use the yaml on a specific branch, you may declare the branch as shown below.

  strict_yaml_branch: master  # only use the latest copy on master branch

Expired Reports

Codecov will reject reports that are over 12 hours old according to the timestamp in the report. This is to prevent reports that may have been accidently checked into git.

To disable this functionality please add the following to your codecov.yml.

  max_report_age: off

Frequently asked questions

Can I name the file .codecov.yml?

Yes. However, the file must still be located in the repository root, dev/, or .github/ directories

What is the purpose of the codecov.yml file?

The Codecov Yaml file is the single-point of configuration, providing the developers with a transparent and version controlled file to adjust all Codecov settings.

Do I need a codecov.yml file?

No. Review our default yaml, which all projects use. However, if you need to customize your project in Codecov, or add new notifications, then the yaml is required.

How do I encrypt data that I do not want public?

Head over to your repository settings page; click the Yaml tab. You will find the Create new secret string section in the UI. Information on how to create and use these strings is found in the app.

Why does my bot not match the one I inputted on my yaml?

There are several reasons why the bot specified does not match the one in use:

  • The YAML in your repo is invalid. If you included the bot username in a repository-level YAML, please follow the steps here to determine if this repository-level YAML is valid.

    You might also want to consider setting a bot in the organization-level YAML so it's easier to see what’s going wrong.

  • The bot is not part of the organization. For a team bot to work, it must be part of the organization your repositories live in.

  • The bot was not granted access to the repository you have. To resolve, simply login to Codecov as the bot.

  • The bot's access token has expired. To resolve, log into Codecov again as the bot and grant permission.

Why does the current repository yaml not match what I have in my repo?

There are three possible reasons why the YAML you see in the Current repository yaml section of the /settings/yaml page does not match the one you see in your repo:

  • The YAML in your repo is invalid. When the repoistory-level YAML is invalid, we keep using the last valid YAML provided. To determine whether your YAML is valid, please follow the steps here.

  • The repository-level YAML is not in what Codecov considers the default branch. If the YAML is in a feature branch, you should be able to see it in Current repository yaml section of the /settings/yaml page after merging the feature branch into the default branch. You can identify the default branch in the Default Branch section of the /settings page.

  • Codecov was unable to fetch the new YAML from the repo. This usually happens when the bot user you use (more info) or the provider integration you installed does not have access to the repository in your provider (i.e. GitHub, GitLab, etc). It's also possible you unintentionally specified the wrong bot user.

Did this page help you?