fix(ci): add explicit permissions to docker jobs to fix ghcr push failure - #333
Merged
Merged
Conversation
|
@Harshita264 is attempting to deploy a commit to the Nitya Gosain's projects Team on Vercel. A member of the Team first needs to authorize it. |
Nitya-003
approved these changes
Jul 19, 2026
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.
Closes #256
What This PR Does
Adds explicit permissions blocks to the build-and-test-docker and security-scan jobs in .github/workflows/ci.yml to fix the GHCR push failure.
Root Cause
The workflow had a top-level permissions block with packages: write, but GitHub Actions does not reliably propagate top-level permissions to individual jobs when using fine-grained tokens or GitHub App installations. The build-and-test-docker job was attempting to push to ghcr.io/nitya-003/innerhue:main without an explicit packages: write grant at the job level, causing:
Changes Made
Added explicit permissions block to two jobs in ci.yml:
build-and-test-dockersecurity-scanThe top-level permissions block, docker/login-action registry config, and GITHUB_TOKEN usage were already correct — no other changes were needed.
Testing
This fix can be verified by merging to main and observing the build-and-test-docker job successfully push toghcr.io/nitya-003/innerhue:main without the denied error.
Why This Matters
The Docker publish pipeline has been broken since the workflow was introduced. Without this fix, no Docker images are ever pushed to GHCR, making the entire CI/CD publish pipeline non-functional.