[ACCEPTED]-Why is my coveralls.io badge not updating even when the builds are happening?-coveralls

Accepted answer
Score: 15

If clearing your local cache isn't fixing 8 the image, the problem is likely that it 7 was cached by Github as a part of their 6 image URL anonymization process.

You can 5 force Github to clear their cache of the 4 image with the following curl command. Change 3 the example URL to the one from the your 2 repo, it will always be https://camo.githubusercontent.com/ followed by a long 1 hash.

curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223....

Source: GitHub Help: About anonymized image URLs

Score: 9

What am I missing?

It's possible that your 7 browser cached the image. I realized this 6 was happening to me recently. I couldn't 5 understand why my badge said one thing on 4 my github page, but something different 3 on the badge's website.

Now I tend to check 2 websites in a Chrome incognito window so 1 I don't have the cache to worry about.

Score: 5

In my case, I had the code coverage outdated 6 in my coveralls badge with this Markdown 5 snippet:

[![Coverage Status](https://coveralls.io/repos/github/user-repo/user-project/badge.svg?branch=master)](https://coveralls.io/github/user-repo/user-project?branch=master)

But when I removed the branch parameter 4 of the first URL, the coverage gets updated!

[![Coverage Status](https://coveralls.io/repos/github/user-repo/user-project/badge.svg)](https://coveralls.io/github/user-repo/user-project?branch=master)

Update:

My 3 first solution didn't work the second time 2 though. So I reverted it, and resorted to 1 changing the badge type from SVG to PNG.

[![Coverage Status](https://coveralls.io/repos/github/user-repo/user-project/badge.png?branch=master)](https://coveralls.io/github/user-repo/user-project?branch=master)
Score: 4

Since posting this question I have pushed 15 more commits and rerun the coveralls task 14 a number of times and the coverage badge 13 now works:

https://github.com/cfogelberg/grunt-set-app-mode/compare/4FB59ACC...58E23E5373

It is not clear why it works now 12 and didn't earlier. coveralls has been added 11 to the default task since the previous failed 10 build on coveralls. However, it was added 9 to the default task and pushed to Github 8 earlier than the next build on coveralls, which 7 only changes the README.md file (fixing 6 a link to a david-dm.org badge).

I'm afraid 5 this isn't really a "solution" as 4 such and I would still love to know (not 3 sure why/who voted the question down), but 2 in any case I hope this information is useful 1 to someone else in the future.

Score: 2

Your browser cached the badge image. To 3 force an update, hold SHIFT while reloading 2 your browser tab (on Brave on macOS, I do 1 this via CMD + R).

Score: 1

Add a queryString param to the badge image 1 URL, Here is the answer https://github.com/lemurheavy/coveralls-public/issues/1065#issuecomment-435494495

Score: 1

I've come arround this issue adding a PURGE 4 request to purge GitHub's cached copy of 3 the badge at the end of a my github actions 2 workflow:

$ curl -X PURGE https://camo.githubusercontent.com/4d04abe0044d94fefcf9af2133223....

i 've used the http-request-action 1 :

- name: refresh coverage badge
      uses: fjogeleit/http-request-action@master
      with:
        url: https://camo.githubusercontent.com/12c4fcb3b21fbb2a725fc61449fb1b91e972c4c8a2baaf5904936d8e334bdbe8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f62336230302f63736c792f62616467652e7376673f6272616e63683d64657626736572766963653d676974687562
        method: PURGE
Score: 1

For me the problem was that the image was 3 cached by github, not my own browser. There 2 is a fix documented here that worked:

I added 1 'kill_cache=1' in the image url

ex: src="https://coveralls.io/repos/github/spread-the-code/git-commiter-nodejs/badge.svg?branch=master&kill_cache=1" />

https://github.com/lemurheavy/coveralls-public/issues/1065

Score: 0

I have tried other proposals here, and none 14 of them seems to work.

Install disable Cookies 13 chrome extension from here.

Go to your github 12 project, press disable cookies, and then 11 restore them back.

coveralls.io badge should 10 be updated after that.

Suspect same problem 9 is applicable also to normal users as well.

In 8 my case image failed to refresh no manner 7 how many times I've pressed reload, used 6 purge or so other tricks (did not want to 5 clear history).

Also anonymous web browsing 4 sometimes helps.

Please note that coveralls.io 3 report takes time to be processed, so need 2 to wait couple of minutes at least. (Can 1 be checked from coveralls.io site).

Score: 0

@iamdefinitelyahuman Answer helped me, but 22 I would like to add some more things that 21 weren't clear to me.

I had the same issue. My 20 coveralls status badge was showing an old 19 coverage percentage. The reason was that 18 the badge was cached by GitHub so I had 17 to clean it using a curl command.

In the beginning, I 16 didn't realize where to get the URL "https://camo.githubusercontent.com/...". After 15 some time I understood that it is the badge 14 image path that can be taken by inspecting 13 the image element.

Then I opened Powershell 12 which was a mistake and run the command: curl -X PURGE https://camo.githubusercontent.com/a4550375d0d4b6f1b363909b2aeeb2827303e07388abe00c0662700f1514fef5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d69636861656c5a61736c6176736b792f736f6369616c2d6576656e742d6d616e616765722f62616467652e737667.

And 11 I got this error: enter image description here

Then I tried to run this 10 command in CMD and it worked properly. { "status": "ok", "id": "10525-1659579296-180434" }.

Then 9 I still didn't see it on my browser as it 8 was my browser cache issue. I knew it is 7 a browser cache as I could see the new coverage 6 percentage in Incognito.

Lastly, I cleaned 5 the cache of my browser by opening the developer's 4 tools (F12) => Right-click on the refresh 3 button => Empty Cache and Hard Reload. And, that 2 I could see the percentage updated in my 1 browser as well.

More Related questions