Class GhcrHelper
Helper for GitHub Container Registry (ghcr.io) operations.
public static class GhcrHelper
- Inheritance
-
GhcrHelper
- Inherited Members
Methods
ExtractOwnerFromTag(string)
Extracts the GitHub owner from a ghcr.io image reference.
public static string? ExtractOwnerFromTag(string imageRef)
Parameters
imageRefstringImage reference (e.g., "ghcr.io/owner/image:tag").
Returns
- string
The owner, or null if not a valid ghcr.io reference.
ExtractOwnerFromTags(IEnumerable<string>)
Extracts the GitHub owner from a list of image tags. Returns the owner from the first ghcr.io tag found.
public static string? ExtractOwnerFromTags(IEnumerable<string> tags)
Parameters
tagsIEnumerable<string>List of image tags.
Returns
- string
The owner, or null if no ghcr.io tags found.
LoginAsync(ICommandExecutor, IBuildLogger, string, string)
Logs in to GitHub Container Registry using the provided token and owner.
public static Task<bool> LoginAsync(ICommandExecutor executor, IBuildLogger logger, string token, string owner)
Parameters
executorICommandExecutorCommand executor to run docker login.
loggerIBuildLoggerLogger for output.
tokenstringGitHub token with packages:write scope.
ownerstringGitHub owner (user or organization).