version-checker
version-checker copied to clipboard
ghcr.io: List packages based on whether owner is an org or a user
We were previously using releases to figure out tags for a Github package. I think this was wrong. Not all release tags will be pushed as package versions, and vice versa. Someone may choose to use GHCR without taking advantage of releases at all.
I've modified it so that the client will check if the owner is a user or an org and then make the appropriate PackageGetAllVersions
function call to retrieve the tags.
I've also fixed a few other things I ran into while testing this:
- Create the github client in
New
so that rate limiting and other goodness is reused across calls. - Fix
RepoImageFromPath
, so it will split the repository path into the 'owner' and 'repo' segments thatTags
expects. Previously we would have got errors for subrepositories. - Update
TestRepoImage
to ensure it doesn't panic on unexpected inputs. - We don't need to use regex to match
ghcr.io
toghcr.io
. - If we're excluding
.att
tags then we should probably exclude.sig
and.sbom
too.
Fixes #179, #175