Skip to content

fix: publish Docker images to all registries after transfer to astroautomata#1273

Open
MilesCranmerBot wants to merge 1 commit into
astroautomata:masterfrom
MilesCranmerBot:fix/docker-publishing
Open

fix: publish Docker images to all registries after transfer to astroautomata#1273
MilesCranmerBot wants to merge 1 commit into
astroautomata:masterfrom
MilesCranmerBot:fix/docker-publishing

Conversation

@MilesCranmerBot

Copy link
Copy Markdown
Contributor

What was broken

After the transfer from MilesCranmer/PySR to astroautomata/PySR, the Docker deploy workflow had two problems:

  1. No packages: write permission — the workflow pushes to GHCR with GITHUB_TOKEN but never declared the permission, so pushes to ghcr.io/astroautomata/pysr would be denied.
  2. Personal GHCR target silently dropped — the image list used ghcr.io/${{ github.repository }}, which resolved to ghcr.io/milescranmer/pysr before the transfer and now resolves to ghcr.io/astroautomata/pysr. The personal-namespace image stopped receiving updates.

Publish targets (all three)

  • docker.io/mcranmer/pysr — unchanged; DOCKERHUB_USERNAME/DOCKERHUB_TOKEN secrets (secrets survive transfers, no action needed)
  • ghcr.io/astroautomata/pysrGITHUB_TOKEN with new packages: write permission
  • ghcr.io/milescranmer/pysr — same GITHUB_TOKEN login (least-privilege; no PAT needed)

Tagging (latest, semver, sha) and the single-arch amd64 build are unchanged.

⚠️ One manual settings change required

The ghcr.io/milescranmer/pysr package is owned by the personal account, so GITHUB_TOKEN from this repo can only push there if the package grants this repo write access:

On https://github.com/users/MilesCranmer/packages/container/pysr/settings → "Manage Actions access" → add astroautomata/PySR with the Write role.

Without that grant, pushes to the personal-namespace image will fail (the org image and Docker Hub are unaffected by that setting). If you'd rather not grant repo access to your personal package, the alternative is a GHCR_PAT secret (classic PAT, write:packages only) — happy to switch the PR to that approach instead.

(I could not verify the package's current access state via API — the bot token lacks the read:packages scope, so the package-settings check above must be done by the package owner.)

…utomata

The docker_deploy workflow pushed to ghcr.io/${{ github.repository }}, which
silently moved ghcr.io/milescranmer/pysr to ghcr.io/astroautomata/pysr after
the repository transfer, and it never requested packages: write permission
for GITHUB_TOKEN.

- Add permissions: packages: write so GITHUB_TOKEN can push to GHCR
- Publish to all three targets explicitly: docker.io/mcranmer/pysr,
  ghcr.io/astroautomata/pysr, and ghcr.io/milescranmer/pysr
- Keep the DOCKERHUB_USERNAME/DOCKERHUB_TOKEN secrets pattern for Docker Hub

Note: pushing to ghcr.io/milescranmer/pysr with GITHUB_TOKEN requires the
package's "Manage Actions access" settings to grant write access to
astroautomata/PySR (package owner action, one-time).

Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants