Skip to content

False positive warning: "Report is N commits behind head on master" when using codecov-action #836

@vivodi

Description

@vivodi

Describe the bug
I have noticed that the Codecov PR comment displays the warning:

Image

Link: Flexget/Flexget#4728 (comment)

This warning appears simply because the PR branch's head commit is historically behind the master branch. However, I believe this warning is misleading and technically incorrect in the context of GitHub Actions.

Reasoning
When using GitHub Actions with the pull_request event, the CI workflow runs on a merge commit by default (refs/pull/:pr/merge), not just the HEAD of the PR branch.

This means that GitHub automatically merges the PR changes with the latest master before running the tests. Consequently, the code being tested—and the resulting coverage report—already includes the latest changes from master.

Conclusion
The coverage report is effectively up-to-date. Codecov seems to be calculating the "behind" status based on the PR branch's history rather than the actual commit (merge commit) being tested in the CI environment.

Expected Behavior
Codecov should detect that the report was generated from a merge commit (which includes the latest master) and suppress the "Report is behind..." warning.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions