insightsengineering / coverage-action

Github Action that generates a coverage summary using a Cobertura XML report
https://github.com/marketplace/actions/code-coverage-report-action
MIT License
16 stars 7 forks source link

[Bug]: Badge Display Issue with Branch Names Containing URL-Unsafe Characters #32

Closed Bolero-fk closed 1 year ago

Bolero-fk commented 1 year ago

What happened?

The issue arises when a branch name includes URL-unsafe characters, such as the hashtag (#). In these cases, the badge fails to display properly.

Steps to Reproduce:

  1. Create or use a branch with a name that contains a URL-unsafe character (e.g., AddNewFeature#1).
  2. Run the coverage-action workflow
  3. Observe that the generated badges do not appear in the pull request comments as expected.

image

Additional Information: I was able to display the badge correctly by manually changing the URL to encode the '#' character. For example, changing the URL from this: ![badge](<RepositoryName>/_xml_coverage_reports/data/AddNewFeature#1/badge.svg) To this: ![badge](<RepositoryName>/_xml_coverage_reports/data/AddNewFeature%231/badge.svg) This modification allowed the badge to be displayed as intended.

Relevant log output

No response

Code of Conduct

Contribution Guidelines

Security Policy

cicdguy commented 1 year ago

Thanks for the detailed report. We're looking into a fix for this. Will notify you when it's been released.

cicdguy commented 1 year ago

This should be fixed now @Bolero-fk Related release: https://github.com/insightsengineering/coverage-action/releases/tag/v2.4.1