-
Notifications
You must be signed in to change notification settings - Fork 63
elevate GITHUB_TOKEN to packages feed credential #1603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jakecoffman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements automatic authentication for GitHub Packages by elevating the GITHUB_TOKEN environment variable to a package feed credential when specific conditions are met: the automatic_github_packages_auth experiment is enabled, GITHUB_TOKEN is available, the package manager supports GitHub Packages, and no duplicate credential exists.
Changes:
- Added automatic GitHub Packages credential generation for NuGet when the experiment flag is enabled
- Extended the
JobDetailstype with asourcefield containing repository information - Added comprehensive test coverage for the new credential generation logic
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/main.ts | Implements getPackagesCredential() and getNuGetPackagesCredential() functions to create GitHub Packages credentials, and integrates them into the main credential workflow |
| src/api-client.ts | Adds source field to JobDetails type to capture repository information needed for constructing package feed URLs |
| tests/main.test.ts | Adds comprehensive test suite for getPackagesCredential() covering various scenarios including experiment flags, token availability, and duplicate detection |
| .gitattributes | Adds binary handling for .exe files (unrelated to main PR purpose) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4222e9e to
da6cfec
Compare
34d818e to
fd10732
Compare
fd10732 to
5462515
Compare
5462515 to
c69d6a8
Compare
When a dependabot job is run, the auto-generated environment variable
GITHUB_TOKENalready has thepackges: readpermissions.This PR uses that value and elevates it to a GitHub package feed credential if:
automatic_github_packages_authis enabledGITHUB_TOKENcan be resolved