Closed Robert-MacWha closed 5 months ago
I see — this might be intended behaviour.
Logging the ChangedPackages
slice, it includes the repo in the package name, while the {old/new}CovPkgs
do not.
changed packages: [github.com/Robert-MacWha/go-coverage-report/cmd/go-coverage-report]
old packages: map[cmd/go-coverage-report:0xc0000d61c0]
new packages: map[cmd/go-coverage-report:0xc0000d6220]
This is because ChangedPackages
pulls from the GitHub repository's name while {old/new}CovPkgs
pulls from go.mod
. I suppose this is why root-package exists, eh?
Yep, that's the issue.
For anyone experiencing similar problems: make sure the value for root-package
in the action workflow.yml
matches the name of your module
in go.mod
.
As title says, when I run the provided sample workflow as part of my CI pipeline a comment is successfully generated, however, the comment does not display the correct information.
I also cloned the go-coverage-report repo (https://github.com/Robert-MacWha/go-coverage-report/pull/1), removed some tests, and ran the CI workflow. This also resulted in no coverage info being displayed in the comment. Interestingly, when I logged the code coverage results, it seemed to correctly generate the
oldCov
andnewCov
structs.I'll see if I can fix things, if so will make a quick PR.