github / gh-valet

Valet helps facilitate the migration of Azure DevOps, CircleCI, GitLab CI, Jenkins, and Travis CI pipelines to GitHub Actions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check if `valet-cli` container is current

ethanis opened this issue · comments

Description

We should add a check before running docker commands in the valet-cli image to see if the version that is running locally is up-to-date with the image in GHCR with the latest tag. If it is not up-to-date, then a console message should be displayed nudging users to run gh valet update.

E.g.

$ gh valet audit azure-devops -o output
A new version of Valet is available. To update, run gh valet update
...

Getting the latest valet-customers/valet-cli image tag from the ghcr container registry requires a github access token with packages:read permission. The only potential solution I can think of is:

Check if they have have passed their ghcr credentials via the command line, or they have a GITHUB_ACCESS_TOKEN defined in their .env.local file. If they do, then attempt to fetch the latest image information from ghcr and compare that to what they have locally. If they do not have an access token defined anywhere, simply don't check if their image is up to date, and don't display a message

@ethanis thoughts on whether to proceed with this story?