Repository navigation
feat(ci): authenticated GHCR probe and opt-in private-image credentials - #925
Merged
Merged
Conversation
The shipped container CI assumed ghcr.io/vig-os/devcontainer was public and unauthenticated. Add first-class support for private / rate-limited pulls: - resolve-image action gains optional registry-token/registry-username inputs, logs in to ghcr.io before the manifest probe when a token is given, and no longer swallows the probe stderr; failures are classified into actionable ::error:: annotations distinguishing auth/denied from a missing tag. - Every shipped container job gets an opt-in credentials: block (github.actor + secrets.GHCR_PULL_TOKEN || github.token) and packages: read; resolve-image callers pass the same token/username to the action. - Public consumers are unaffected: with GHCR_PULL_TOKEN unset the fallback is github.token (never an empty password), which authenticates a public pull. - container-ci-quirks.md re-framed from a public-image limitation into first-class authenticated-pull docs; probe auth-branch bats-style pytest added. Refs: #920, #854, #781
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.
Closes #920
Split out from the shipped-CI audit (#854, audit item 8) and rides the devkit rename cycle (#781). The shipped container-based CI assumed
ghcr.io/vig-os/devcontainerwas public and unauthenticated; this adds first-class support for private / rate-limited (authenticated) GHCR pulls without breaking public consumers.What changed
1. Authenticated probe in
resolve-image(.github/actions/resolve-image/action.yml, SSoT; mirror underassets/workspace/regenerated bysync-manifest)registry-token/registry-username(default'').docker login ghcr.ioruns before the manifest probe; the anonymous path is kept for public images.::error::that distinguishes an auth/denied failure (setGHCR_PULL_TOKEN/ grantpackages: read) from a genuinely missing tag. The tag-resolution step is untouched.2. Opt-in credentials on shipped container jobs
Every shipped workflow job that declares
container: { image: … }gets:plus
packages: read(added at workflow level where jobs inherit, or in the job's ownpermissions:block otherwise — no existing permission removed). Everyresolve-imagecaller passesregistry-token: ${{ secrets.GHCR_PULL_TOKEN || github.token }}andregistry-username: ${{ github.actor }}.Jobs that received a
credentials:block (16):ci.yml:lint,testrenovate-changelog-build.yml:build(root SSoT + mirror)release.yml:rollbackrelease-core.yml:validate,finalize,testrelease-publish.yml:publishprepare-release.yml:preparepromote-release.yml:validate,promote,merge,cleanupsync-main-to-dev.yml:check,syncsync-issues.yml:sync3. Docs —
assets/workspace/docs/container-ci-quirks.mdre-framed from a "public-image limitation" note into first-class authenticated-pull documentation (theGHCR_PULL_TOKENsecret contract, thegithub.tokenfallback, and thepackages: readrequirement).Public-consumer safety
The change is opt-in and non-breaking. With
GHCR_PULL_TOKENunset,${{ secrets.GHCR_PULL_TOKEN || github.token }}falls back to the automaticGITHUB_TOKEN— never an empty password — and an authenticated pull of a public image withGITHUB_TOKENsucceeds.packages: readis what lets that automatic token read the package. Private-image consumers setGHCR_PULL_TOKEN(or rely on an automatic token with org package access) and the same expression authenticates the pull.Verification
tests/test_resolve_image_probe.pyextracts the probe step's real bash body and drives it against a stubbeddocker, asserting: quiet success (anonymous), login runs only when a token is present, denied→auth::error::, missing→missing-tag::error::, and failed-login→auth::error::.test_resolve_image_probe.py+ existingtest_resolve_image_manifest.py: 7 passed.tests/test_install_script.py: 23 passed (scaffolded-workspace file checks unaffected).just precommit(prek run --all-files) green for both theassets/workspaceand root hook sets — includingcheck-yaml,yamllint,check-action-pins,sync-manifest(mirror parity),generate-docs,shellcheck. Noactionlinthook is wired in this repo; YAML validity is enforced bycheck-yaml+yamllint, and all 12 changed YAML files parse.Changelog
Added under
## Unreleased→### AddedinCHANGELOG.md(root SSoT; the.devcontainer/CHANGELOG.mdmirror is regenerated by thesync-manifesthook), cross-linking #854.