Skip to content

release workflow: the cut job can't pull a private GHCR base with the run's token (packages scope dropped) #5486

Closed

Description

@lex00

A release.images base in a private GHCR package can't be pulled with the run's own token, because the dispatched cut job never gets packages: read, even when release.workflow.permissions asks for it.

Found while proving #5457 against ghcr.io (epic #5452), at @intentius/chant 0.124.116.

Reproduction

chant.config.ts:

release: {
  green: "forge-checks",
  workflow: {
    trigger: "dispatch",
    permissions: { packages: "read" },
    env: { PULL_USERNAME: "${{ github.actor }}", PULL_PASSWORD: "${{ github.token }}" },
  },
  images: [{ name: "app", dockerfile: "Dockerfile", platforms: ["linux/amd64"],
    pull: [{ registry: "ghcr.io", usernameEnv: "PULL_USERNAME", passwordEnv: "PULL_PASSWORD" }] }],
  publish: [{ type: "oci", image: "dist/images/app.tar", repository: "ghcr.io/<org>/app" }],
}

with FROM ghcr.io/<org>/base:1@sha256:..., a private package of the same repository. chant release workflow renders:

  • the cut job's permissions: without packages (jobPermissions in workspace/release-workflow.ts skips packages for the cut: "The cut never takes packages");
  • the publish job's packages: read, which replaces the packages: write the ghcr.io target adds, so the push would then fail.

The cut's docker login ghcr.io succeeds and the build fails:

#3 ERROR: unexpected status from HEAD request to https://ghcr.io/v2/<org>/base/blobs/sha256:...: 403 Forbidden
denied: installation not allowed to Read organization package

Expected

docs/.../cli/release/workflow.mdx says "A scope from permissions goes to the cut and the publish job". Either:

  • the cut takes packages: read (never write) from permissions, or when a pull entry names ghcr.io with the run's token; or
  • the docs say the cut never gets packages, so a private GHCR base needs a pull token in secrets, and the doctor or the render warns when a pull entry on ghcr.io reads github.token.

A packages: read from permissions should not lower the publish job's packages: write either, or the render should refuse it.

Activity

  1. added
    epic:ci-hardening
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:ci-hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions