fix: publish Docker images to all registries after transfer to astroautomata#1273
Open
MilesCranmerBot wants to merge 1 commit into
Open
fix: publish Docker images to all registries after transfer to astroautomata#1273MilesCranmerBot wants to merge 1 commit into
MilesCranmerBot wants to merge 1 commit into
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What was broken
After the transfer from
MilesCranmer/PySRtoastroautomata/PySR, the Docker deploy workflow had two problems:packages: writepermission — the workflow pushes to GHCR withGITHUB_TOKENbut never declared the permission, so pushes toghcr.io/astroautomata/pysrwould be denied.ghcr.io/${{ github.repository }}, which resolved toghcr.io/milescranmer/pysrbefore the transfer and now resolves toghcr.io/astroautomata/pysr. The personal-namespace image stopped receiving updates.Publish targets (all three)
docker.io/mcranmer/pysr— unchanged;DOCKERHUB_USERNAME/DOCKERHUB_TOKENsecrets (secrets survive transfers, no action needed)ghcr.io/astroautomata/pysr—GITHUB_TOKENwith newpackages: writepermissionghcr.io/milescranmer/pysr— sameGITHUB_TOKENlogin (least-privilege; no PAT needed)Tagging (
latest, semver, sha) and the single-arch amd64 build are unchanged.The
ghcr.io/milescranmer/pysrpackage is owned by the personal account, soGITHUB_TOKENfrom 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/PySRwith theWriterole.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_PATsecret (classic PAT,write:packagesonly) — 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:packagesscope, so the package-settings check above must be done by the package owner.)