Updated the workflow file so that it can deploy snapshot on our priva…#479
Merged
Conversation
yashmeet29
approved these changes
May 6, 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.
Describe your changes
Fix snapshot deployment authorization for private repository
Problem
After making the repository private, the snapshot deployment workflow was failing with 403 Forbidden errors when attempting to publish to GitHub Packages:
Root Cause
The workflow was using a custom token (secrets.GIT_TOKEN) instead of the auto-generated GITHUB_TOKEN
Missing explicit permissions required for private repository access
contents: read permission was insufficient for git push operations
Changes
Build job: Added contents: read permission for private repo checkout
Update-version job: Upgraded from contents: read to contents: write (required for git push)
Deploy step: Replaced secrets.GIT_TOKEN with secrets.GITHUB_TOKEN for proper authorization
Benefits
✅ Uses GitHub's auto-generated token (more secure, auto-expires after workflow completion)
✅ Follows principle of least privilege with explicit permission scoping
✅ Resolves authentication issues with private repository and GitHub Packages
✅ No manual token management or rotation required
Testing
Workflow successfully deploys SNAPSHOT versions to GitHub Packages
Version increment and commit push operations work correctly
Any documentation
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested