Add opt-in GHCR latest-version lookup from GitHub Releases#435
Open
Add opt-in GHCR latest-version lookup from GitHub Releases#435
Conversation
Agent-Logs-Url: https://github.com/jetstack/version-checker/sessions/44c369a1-f255-4e72-a65e-7d29c592f852 Co-authored-by: davidcollom <1504448+davidcollom@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jetstack/version-checker/sessions/44c369a1-f255-4e72-a65e-7d29c592f852 Co-authored-by: davidcollom <1504448+davidcollom@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for using GitHub Releases as source for latest images
Add opt-in GHCR latest-version lookup from GitHub Releases
May 9, 2026
davidcollom
approved these changes
May 9, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in mechanism for GHCR images to source “latest version” candidates from the backing GitHub repository’s Releases (instead of GHCR package tags), improving correctness for projects where GHCR tags aren’t a reliable version signal.
Changes:
- Introduces
use-github-release.version-checker.io/<container>: "true"annotation, plumbed intoapi.Optionsand the controller option builder. - Extends the registry client interface to accept options and adds a GHCR GitHub-Releases lookup path that converts release tags into
ImageTagcandidates (skipping drafts). - Separates caching for release-backed lookups vs tag-backed lookups, and documents a known configuration for
ghcr.io/n8n-io/n8n.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/version/version.go | Passes options through cache fetch and separates image-tag cache keys for release-backed lookups. |
| pkg/version/version_test.go | Updates mocks/tests to match the new Tags(..., opts) signature. |
| pkg/controller/options/options.go | Adds parsing of the new use-github-release annotation into api.Options. |
| pkg/controller/options/options_test.go | Adds test coverage for the new option and its incompatibility with use-sha. |
| pkg/client/ghcr/ghcr.go | Implements GitHub Releases listing and converts release tags to ImageTag entries with timestamps. |
| pkg/client/ghcr/ghcr_test.go | Adds unit test coverage for GHCR release tag extraction behavior (draft filtering, timestamps). |
| pkg/client/client.go | Extends client handler API with options and routes GHCR lookups to Releases when opted in. |
| pkg/client/client_test.go | Adds an integration-style test ensuring the client uses Releases for GHCR when configured. |
| pkg/api/options.go | Adds UseGitHubRelease option flag. |
| pkg/api/annotations.go | Adds UseGitHubReleaseAnnotationKey constant. |
| known-configurations.md | Documents an n8n configuration using the new annotation. |
| docs/installation.md | Documents the new annotation in installation instructions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
130
to
138
| repo, image := client.RepoImageFromPath(path) | ||
|
|
||
| if opts != nil && opts.UseGitHubRelease { | ||
| if ghcrClient, ok := client.(*ghcr.Client); ok { | ||
| return ghcrClient.ReleaseTags(ctx, repo, image) | ||
| } | ||
| } | ||
|
|
||
| return client.Tags(ctx, host, repo, image) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some GHCR-backed projects publish the version signal in GitHub Releases rather than in container package tags, which makes latest-version detection unreliable for those images. This change adds an explicit per-container switch to source latest versions from GitHub Releases when needed, and documents a known configuration for
n8n.New annotation for GHCR release-backed version discovery
use-github-release.version-checker.io/<container>: "true"to opt a container into GitHub Releases as the source of version candidates.GHCR client support for GitHub Releases
ImageTagentries.Option plumbing through version resolution
Docs and known configurations
ghcr.io/n8n-io/n8n.Example: