Skip to content

feat(release): publish to GHCR with GITHUB_TOKEN when the registry secrets are empty (DF15b) - #5

Merged
crazyracer98 merged 3 commits into
mainfrom
wip/DF15b
Oct 28, 2026
Merged

crazyracer98 merged 3 commits into
mainfrom
wip/DF15b

Conversation

@crazyracer98

Copy link
Copy Markdown
Contributor

release-features.sh publish authenticates to GHCR with the release job's GITHUB_TOKEN (as GITHUB_ACTOR) when OCI_REGISTRY=ghcr.io and the OCI_REGISTRY_USERNAME/OCI_REGISTRY_PASSWORD secrets are empty. Explicit secrets still win, and both are required when either is set. Any other registry still needs the secrets. The credential reaches the Dev Container CLI only through DEVCONTAINERS_OCI_AUTH (registry|user|token, checked against @devcontainers/cli 0.89.0), and GITHUB_TOKEN is removed from the CLI's environment.

  • When publish fails, the error names the credential it used. In GITHUB_TOKEN mode it also names the two likely causes: the build job's packages: write, and each existing package's "Manage Actions access".
  • New ADR 0005 partly supersedes ADR 0004, and the README's "Releasing the collection" section is updated.

Depends on: template-base's DF15a release (packages: write on release.yml's build job) reaching this repo through template-sync. Until then, a full release with empty secrets can't push with GITHUB_TOKEN: GHCR denies the push, and make publish fails with the hint.

…crets are empty (DF15b)

- release-features.sh publish: on OCI_REGISTRY=ghcr.io with neither OCI_REGISTRY_USERNAME nor OCI_REGISTRY_PASSWORD set, authenticate with GITHUB_TOKEN as GITHUB_ACTOR via DEVCONTAINERS_OCI_AUTH; explicit secrets still win
- keep the failure modes: one secret only, non-ghcr without secrets, ghcr without secrets or GITHUB_TOKEN (names packages: write)
- ADR 0004: dated amendment (Decision text left as accepted, per docs/adrs/README.md)
- README: GHCR publishing needs only the OCI_REGISTRY variable once base's release.yml grants packages: write
…, clearer one-secret errors (DF15b)

- publish: on a CLI failure, die naming the auth source; in GITHUB_TOKEN mode also packages: write and per-package Manage Actions access
- one-secret errors say to set both or, on ghcr.io, delete both
- README: migration from the secrets, per-package Actions access
…eding 0004 (DF15b)

- new ADR 0005; 0004 keeps only a Status pointer (in-place amendment removed)
- README links ADR 0005
@crazyracer98 crazyracer98 self-assigned this Oct 28, 2026
@crazyracer98
crazyracer98 merged commit a4ce997 into main Oct 28, 2026
169 of 170 checks passed
@crazyracer98
crazyracer98 deleted the wip/DF15b branch October 28, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant