Table of Contents

Class GhcrHelper

Namespace
Ando.Utilities
Assembly
ando.dll

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

imageRef string

Image 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

tags IEnumerable<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

executor ICommandExecutor

Command executor to run docker login.

logger IBuildLogger

Logger for output.

token string

GitHub token with packages:write scope.

owner string

GitHub owner (user or organization).

Returns

Task<bool>

True if login succeeded, false otherwise.