ci(workflows): fix permissions for GHCR push in update-current-image#299
Closed
chorrell wants to merge 1 commit into
Closed
ci(workflows): fix permissions for GHCR push in update-current-image#299chorrell wants to merge 1 commit into
chorrell wants to merge 1 commit into
Conversation
The update-current-image workflow was failing to push to GitHub Container Registry (GHCR) with 'permission_denied: write_package' errors due to missing packages:write permission. Added explicit job-level permissions following least privilege principle: - build job: contents:read + packages:write (for building and pushing images) - merge job: contents:read + packages:write (for creating multi-arch manifests) - check_version job: contents:read (for repository access only) - Removed packages:write from workflow-level permissions (per zizmor audit)
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.
Problem
The
update-current-imageworkflow was failing to push Docker images to GitHub Container Registry (GHCR) with:This occurred because the workflow lacked the required
packages:writepermission to authenticate withGITHUB_TOKENfor GHCR operations.Solution
Added explicit job-level permissions following the principle of least privilege:
contents:read+packages:write(for building and pushing per-platform images)contents:read+packages:write(for creating multi-arch manifests)contents:read(for repository checkout only)Removed
packages:writefrom workflow-level permissions to comply with security audit (zizmor) recommendations.Testing