I use a Coveralls badge on the README and documentation page to display the code coverage for my project. The badge image often displays an out-of-date percentage. Clearing my browser's cache helps, but that often still gets me an out-of-date percentage image as well, although it might be more up-to-date than the previously displayed badge.
For example, at the time of this writing the badge displays the correct percentage, currently at 91%, on the documentation page at readthedocs.io, but the badge on my GitHub README displays 89%.
How can I manually force the badge image to update on the GitHub README, i.e. how to manually pull/force an updated image from Coveralls that shows the correct percentage?
Clearing the browser cache did not work for me.
An answer on GitHub helped:
I was able to fix this issue on my repo by purging GitHub's cached copy of the badge:
$ curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223....
More detailed info is available here - https://help.github.com/en/articles/about-anonymized-image-urls
Hopefully this saves someone else the frustration I just went through :)
Add a queryString param to the badge image URL, for instance:
<img src="https://coveralls.io/repos/github/spread-the-code/git-commiter-nodejs/badge.svg?branch=master&kill_cache=1"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With