Code coverage uploads no longer fail CI for new branches

Code coverage uploads from the GitHub Code Quality upload-code-coverage action no longer fail CI when you push a branch that doesn’t yet have an open pull request.

Previously, the coverage API required a pull request number for any push to a non-default branch. Since that number only exists once a pull request is open, pushing a new branch before opening a pull request caused the coverage-upload step to fail, even though nothing was actually wrong with your workflow.

Now, when the action runs on a push to a branch without an associated pull request, it skips the upload instead of failing, and explains why in an Actions notice and step summary. This applies to:

  • Pushes to branches that don’t yet have an open pull request.
  • Subsequent pushes to those branches, until a pull request is opened.

Uploads for pushes to your default branch, and for supported pull request events, continue to work exactly as before, so you don’t need to change any existing workflow configuration.

If your workflow uploads coverage only on push events, opening a pull request won’t trigger a new upload by itself—coverage resumes on the next push to that branch. If you want coverage to upload as soon as a pull request opens, add a pull_request trigger to your workflow.

This change is available now on GitHub Enterprise Cloud and GitHub Team, including GitHub Enterprise Cloud with data residency. It isn’t available on GitHub Enterprise Server. Learn more about setting up code coverage for your repository.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论