PackageFeedHelper

Makes a node able to RESTORE the osisa package graph, which is what separates a machine that merely runs CI jobs from one that can actually build.

Note

The repository’s NuGet.Config declares two sources that a plain Windows install cannot satisfy: a local LocalBuild directory, and the GitHub Packages feed whose credentials it reads from the GITHUB_PACKAGES_USER / GITHUB_PACKAGES_TOKEN environment variables. Neither exists on a fresh node, and the resulting failure is a wall of NU1301 plus a 401 that says nothing about the actual cause.

Measured on devRunner02, run 34477949026: checkout and the WSL/Docker capabilities were all healthy, the job still died in "Publish NETSetup binaries" with Die lokale Quelle "C:\_gh\packages" ist nicht vorhanden followed by AsciiDocSharp ... 401 (Unauthorized). A workflow-level GITHUB_TOKEN does NOT help: the config reads the GITHUB_PACKAGES_* pair by name and nothing else sets it.

The variables are set at MACHINE scope on purpose. The GitHub Actions runner starts from a scheduled task in the autologon session, so a user-scope variable set by another account never reaches it.

public static class PackageFeedHelper

1. Methods

1.1. ConfigureFeedAccess(ISystemHost, string, SecretString, string)

Publishes the package-feed credentials and ensures the local feed directory exists. Idempotent - safe to run on a node that already has both.

public static bool ConfigureFeedAccess(ISystemHost host, string username, SecretString token, string localFeedPath)
Table 1. Parameters
Name Type Description

host

ISystemHost

Host to configure.

username

string

Feed username, taken from the config’s User entity.

token

SecretString

Feed token, taken from that same User entity. Never logged.

localFeedPath

string

Directory backing the LocalBuild source. Created empty when missing: NuGet fails the whole restore when a declared local source does not exist, while an EMPTY one simply matches nothing and lets the remaining sources answer. Null skips the directory entirely.

Returns: bool — True when the credentials were actually published. False on every skip - wrong platform, no token, or a failed script - so the caller does NOT write an idempotency marker for work that never happened and the next run retries instead of being permanently marked done.

1.2. EnsureLocalFeed(ISystemHost, string)

Ensures the LocalBuild feed directory exists, WITHOUT needing any credential.

public static bool EnsureLocalFeed(ISystemHost host, string localFeedPath)
Table 2. Parameters
Name Type Description

host

ISystemHost

Host to configure.

localFeedPath

string

Directory backing the LocalBuild source.

Returns: bool — True when the directory exists afterwards.