Advice on Automating Multiple Checks for Updates

OK so there is probably something simple I’ve missed!

What I am trying to do is write a scheduled task (e.g. weekly) that interrogates multiple GitHub repositories to see if components our code uses have recent updates.

Components like Jedi Component Library and Pavkam’s TZdb Component (plus sundry others).

What I’ve tried so far is to open links in my App one after the other and compare Buffer Lengths / Checksums etc. with stored values. A difference flags a change, right?

Well it does on other sources of Components (with probably more primitive websites), but I tend to get a flag for “change” every visit to a GitHub link, for example: https://github.com/pavkam/tzdb/releases

It is pretty obvious why when you look at the page, but I can’t see a better way to do it.

Suggestions?

Cheers, Paul

PS For Alex’s software I was relying on his Blog at https://pavkam.dev/ to do this in the past (worked really well), but I’ve “standardised” on linking to GitHub recently.

P

That depends on whether the thing you download is meant to only change if there is a new release. If you download the releases page for a GitHub repository, there are a lot of other things that might change.

Using the REST API to get the latest release should work much better, and you don’t even need the checksum: Releases - GitHub Docs

Thanks for the prompt response! This looks promising, I’ll investigate further in a day or so. It should be quite straight-forward to change my code to use the API etc. so I should get results quite soon…

Cheers, Paul

1 Like
  • Update *

Changes made per the advice above are working 80% perfectly.

Now I just have to solve the cases where an “Owner” / “Repository” doesn’t have “Releases” (just “Branches”).

But otherwise very happy :sunglasses:

Cheers, Paul

1 Like

G’day team,

After a bit of experimentation I believe I have a solution for those Repositories not organised into Releases.

If I drop the “/releases/latest” off the API “call” I get a JSON page with:

  • created_at
  • updated_at
  • pushed_at

I need to check that “Updated At” / “Pushed At” are present in every case. If so this is a good fall-back for not having “Published At”.

But I think we’ve now wrapped up the issue!

Cheers, Paul

1 Like