-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
feat(cli): deploy command should allow customizing git config user.name / user.email in deployment branch (#9101) #9102
Conversation
…e and user.email in deployment branch (facebook#9101)
Hi @amdshrif! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
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.
Do we really need this?
What prevents from replacing:
export GIT_USER_NAME="xyz"
export GIT_USER_EMAIL="my@email.com"
yarn deploy
With:
git config user.name "xyz"
git config user.email "my@email.com"
yarn deploy
const gitUserName = process.env.GIT_USER_NAME; | ||
if (gitUserName) { | ||
shellExecLog(`git config user.name "${gitUserName}"`); | ||
} | ||
|
||
const gitUserEmail = process.env.GIT_USER_EMAIL; | ||
if (gitUserEmail) { | ||
shellExecLog(`git config user.email "${gitUserEmail}"`); | ||
} |
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.
not super fan of having config side-effects like this, and features without documentation
The suggested enhancement will only update the user.name and user.email locally on the repo level, while keeping the global git config as-is and I do not have to bother to keep switching between personal and work emails for every work I do on my machine. The new enhancement works well with a local shell script that exports the other env variable settings all together. env-setting.sh export USE_SSH=true
export GIT_USER="amdshrif"
export CURRENT_BRANCH="deployment"
export GIT_USER_NAME="Ahmad Shrif"
export GIT_USER_EMAIL="ahmad.shrif@gmail.com" source env-settings.sh |
Sorry, but I don't understand your answer.
Isn't it the intended behavior in both cases? I'll ask again: Does the following work to deploy with the specified username/email, yes or not? git config user.name "Ahmad Shrif"
git config user.email "ahmad.shrif@gmail.com"
yarn deploy Have you tested it? If it does not work, can you tell me what's the behavior you see, and what's the behavior you want? |
Ok I understand the problem now, there are 2 repositories involved:
We need to set the config on the cloned deployment I'm ok to merge this, but please add some documentation for these env variables |
Yes, that the is correct. Actually it is one repository and two branches, when we run I will update the PR to update the docs and testing. |
Thanks, added the docs to your pr already :) |
Pre-flight checklist
Motivation
Fix #9101
Test Plan
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs