Skip to content

ci: fix registry image namespaces - #213

Merged
aparcar merged 3 commits into
openwrt:mainfrom
BKPepe:registry-namespace
Sep 18, 2026
Merged

aparcar merged 3 commits into
openwrt:mainfrom
BKPepe:registry-namespace

Conversation

@BKPepe

@BKPepe BKPepe commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Since #204, registry image names are derived from the login user. This
breaks Quay.io robot accounts (org+name) and can also push Docker Hub
images to the wrong namespace.

This PR:

  • uses the repository owner as the default image namespace, with
    DOCKER_NAMESPACE/QUAY_NAMESPACE overrides for forks;
  • uses the same namespace for registry login and image tagging;
  • pushes the image that passed the smoke test instead of rebuilding it;
  • limits GITHUB_TOKEN permissions to contents: read and packages: write.

RootFS images are now pushed as single-platform manifests, without the
provenance attestation.

Tested with act and a fork using Docker Hub and a Quay.io robot account:
all images were pushed to ghcr.io, Docker Hub and Quay.io with the
expected tags and matching digests, and the pushed RootFS image passed
the feeds test.

Fixes #211

Copilot AI lite review requested due to automatic review settings September 14, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Registry image names were derived from the login user, which breaks
Quay.io robot accounts (org+name) and can push Docker Hub images to
the wrong namespace.

Use the repository owner as the default namespace, with optional
DOCKER_NAMESPACE and QUAY_NAMESPACE overrides. Reuse the computed
namespace for both login and image tagging, and keep registry tokens
out of the workflow environment.

Fixes: openwrt#211
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
The Push step ran the whole build again with no-cache, so the pushed
image was not the one that passed the smoke test.

Tag the image ID from the Build step and push it after the smoke test,
so exactly the tested image is published.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
The workflow does not set any permissions, so every job gets the
repository default, which grants write access to everything. Drop all
permissions by default and grant each job only what it needs: reading the
repository, and writing packages to push to ghcr.io.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
@efahl

efahl commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Looks like @jefferyto's insight about the user name is indeed the culprit. #212 (comment)

@efahl

efahl commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Commit it and let's see if it does the pushes. Even if it burns, it can't be any worse that what we've got now, we haven't had a run go through for a couple months now...

@BKPepe

BKPepe commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

@aparcar needs to merge this. I dont have commit rights here.

@BKPepe

BKPepe commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

@aparcar Can you merge this, please?

@aparcar

aparcar commented Sep 18, 2026

Copy link
Copy Markdown
Member

Thanks, looks good to me

@aparcar
aparcar merged commit 333c887 into openwrt:main Sep 18, 2026
201 of 204 checks passed
@BKPepe
BKPepe deleted the registry-namespace branch September 21, 2026 20:17
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.

No new container build and push runs

4 participants