codeclimate-action: Coverage report doesn't appear on the Overview tab
I’ve set up a GitHub Actions workflow to report my test code coverage to Code Climate. The workflow uses this action. As a result, the coverage report appears in the project settings:
![]() |
![]() |
|---|
But doesn’t appear on the Overview tab in Code Climate:
I’ve directed this issue to the Code Climate support, they said that the branch name (provided by this action) must me master instead of refs/heads/master.
The full conversation
Code Climate:
Hi Surgie,
Thanks for reaching out! Happy to help and point you in the right direction.
I haven’t seen this GitHub Action before – pretty cool! I’m not sure how to make changes to the GitHub Action to make this work for you, but here’s what we see on our side:
On the backend, I do see that we’re successfully receiving payloads for this repo (last commit f40b844b); however, they each identify your master branch as:
refs/heads/masterTo help resolve this error, we generally recommend making the path above ^^ relative to the project root.
- You can do this by adding the
--prefixflag to your to your CI’s coverage configuration.- More information is in our docs here.
- It should look something like
--prefix /[path to directory]This removes absolute paths in coverage payloads to make them relative to the project root. This is usually the directory in which the tests were run.
(You could also instruct your test setup to start at the root of your project.)
Again, I’m not sure how to make the above work with the GitHub Action. You might need to open an issue with the maintainer on the project itself: https://github.com/paambaati/codeclimate-action/issues
-> Once you’ve made changes to your setup, could you try pushing a brand new commit to master?
Let me know if you have any questions, or if there’s anything else I can help with. I’ll be standing by to help further.
Thanks, Emily
I:
Hi!
I used the same PhpUnit setup and CLI command with a plain cc-test-reporter command in another repository and it worked fine. Also the reported coverage is shown in the Code section but not in the Overview section.
Will the problem be solved if my action sends the same report but with branch
masterinstead ofrefs/heads/master?I’ll make an issue in the action repository and attach our conversation.
Code Climate:
Hi Surgie,
Thanks for the additional info.
Will the problem be solved if my action sends the same report but with
branchmaster instead ofrefs/heads/master?Yes! That should do the trick 👌
Let me know once you’re able to get that working! I’d love to make some notes for troubleshooting for anyone else who runs into the same.
Thanks, Emily
PS: I couldn’t find the output for the coverage info it in your Workflow logs, but I did some branch name troubleshooting earlier with another GitHub Workflow user. his setup reported branch names to be HEAD and I recommended this stackflow conversation
(here’s the coverage-related Workflow logs from the other user)
Please also consider that a branch can have a slash in its name, e.g. a gitflow-style branch feature/name.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 34 (17 by maintainers)
Commits related to this issue
- core: Remove 'refs/head/' prefix in Git branch name. This should get the coverage to show up in the 'Overview' tab and fix #42. — committed to paambaati/codeclimate-action by paambaati 5 years ago
- ci: Bump codeclimate-action to v2.2.4. Includes fixes for https://github.com/paambaati/codeclimate-action/issues/42 — committed to paambaati/websight by paambaati 5 years ago
- deps: ➖ husky > > Becase this is causing a lot of weird issues (see https://github.com/paambaati/codeclimate-action/issues/42). — committed to paambaati/codeclimate-action by paambaati 5 years ago
- core: Introduce --debug flag support for CodeClimate. Should solve https://github.com/paambaati/codeclimate-action/issues/42#issuecomment-548214177 — committed to paambaati/codeclimate-action by paambaati 5 years ago
- core: Fix the regex. See https://github.com/paambaati/codeclimate-action/issues/42#issuecomment-548214331 — committed to paambaati/codeclimate-action by paambaati 5 years ago
- Fix the Code Climate coverage report (#3) https://github.com/paambaati/codeclimate-action/issues/42 — committed to Finesse/SwiftMailerDefaultsPlugin by Finesse 5 years ago


@paambaati Everything looks good: PR auto comment, debug information and the Overview tab. The issue can be closed.
Thank you!
@paambaati I’m performing the final test on the
masterbranch. I’ll let you know when it finishes.@paambaati The coverage has been successfully reported 🎉
But the
debugoption doesn’t work: https://github.com/Finesse/SwiftMailerDefaultsPlugin/runs/282820415#step:5:4. Maybe you need to add it to action.yml.@vinicius33 That action actually does build
lib/main.js- see https://github.com/paambaati/codeclimate-action/blob/gh-actions/lib/main.jsIt pushes the actual release output to the
gh-actionsbranch.Hey guys, I’m having the same issue. @paambaati let me know if I can help you somehow.
Thanks!
@paambaati Fails with another error: https://github.com/Finesse/SwiftMailerDefaultsPlugin/runs/278808824#step:5:6
@Finesse Thanks for the detailed report. Let me debug this; I’ll try to ship a fix this weekend.