fix(ci): configure git remote with token for authentication#26949
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses CI failures in release workflows caused by recent security hardening. By explicitly setting the git remote URL with an access token, the workflows can now perform authenticated git operations without compromising the security posture of the repository. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the GitHub Actions for creating pull requests and publishing releases by explicitly setting the git remote URL with a GitHub token. However, the review identified significant security concerns regarding the persistence of plain-text credentials in the local git configuration and the risk of command injection. It is recommended to use gh auth setup-git instead to securely manage authentication without storing tokens on disk.
|
Size Change: -4 B (0%) Total Size: 34.1 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request updates the GitHub Actions for creating pull requests and publishing releases by configuring the Git remote URL with an access token. However, the review feedback identifies a security risk where using git remote set-url persists credentials in the .git/config file on disk. It is recommended to either pass the authenticated URL directly to specific Git commands or use the GitHub CLI as a credential helper to maintain security hardening and avoid credential leakage.
Summary
This PR fixes a critical CI failure where release workflows were failing to authenticate with GitHub during
git pushoperations.Details
The issue was introduced in #26897, which added
persist-credentials: falseto various workflows. This preventsactions/checkoutfrom storing the GitHub token in the local git configuration, causing subsequent steps to fail when attempting remote operations.By explicitly setting the remote URL to
https://x-access-token:${TOKEN}@github.com/${REPOSITORY}.git, we ensure that these operations remain authenticated without needing to revert the security hardening ofpersist-credentials: false.Related Issues
Fixes the release job failure in run 25760929873.