Skip to content

Updated the workflow file so that it can deploy snapshot on our priva…#479

Merged
yashmeet29 merged 1 commit into
developfrom
fix_snapshotDeployment
May 6, 2026
Merged

Updated the workflow file so that it can deploy snapshot on our priva…#479
yashmeet29 merged 1 commit into
developfrom
fix_snapshotDeployment

Conversation

@vibhutikumar07

Copy link
Copy Markdown
Contributor

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I follow Java Development Guidelines for SAP
  • I have tested the functionality on my cloud environment.
  • I have provided sufficient automated/ unit tests for the code.
  • I have increased or maintained the test coverage.
  • I have ran integration tests on my cloud environment.
  • I have validated blackduck portal for any vulnerability after my commit.

Upload Screenshots/lists of the scenarios tested

  • I have Uploaded Screenshots or added lists of the scenarios tested in description

@vibhutikumar07 vibhutikumar07 requested a review from yashmeet29 May 6, 2026 05:48
@yashmeet29 yashmeet29 merged commit f41ee9e into develop May 6, 2026
10 checks passed
@yashmeet29 yashmeet29 deleted the fix_snapshotDeployment branch May 6, 2026 06:32
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