mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
feat(cli): deploy command should allow customizing git config user.name / user.email in deployment branch (#9101) (#9102)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
e8c1312793
commit
26ae4164d6
2 changed files with 12 additions and 0 deletions
|
@ -215,6 +215,16 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
|
||||||
}
|
}
|
||||||
shellExecLog('git add --all');
|
shellExecLog('git add --all');
|
||||||
|
|
||||||
|
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}"`);
|
||||||
|
}
|
||||||
|
|
||||||
const commitMessage =
|
const commitMessage =
|
||||||
process.env.CUSTOM_COMMIT_MESSAGE ??
|
process.env.CUSTOM_COMMIT_MESSAGE ??
|
||||||
`Deploy website - based on ${currentCommit}`;
|
`Deploy website - based on ${currentCommit}`;
|
||||||
|
|
|
@ -290,6 +290,8 @@ By default, GitHub Pages runs published files through [Jekyll](https://jekyllrb.
|
||||||
| `GIT_USER` | The username for a GitHub account that **has push access to the deployment repo**. For your own repositories, this will usually be your GitHub username. Required if not using SSH, and ignored otherwise. |
|
| `GIT_USER` | The username for a GitHub account that **has push access to the deployment repo**. For your own repositories, this will usually be your GitHub username. Required if not using SSH, and ignored otherwise. |
|
||||||
| `GIT_PASS` | Personal access token of the git user (specified by `GIT_USER`), to facilitate non-interactive deployment (e.g. continuous deployment) |
|
| `GIT_PASS` | Personal access token of the git user (specified by `GIT_USER`), to facilitate non-interactive deployment (e.g. continuous deployment) |
|
||||||
| `CURRENT_BRANCH` | The source branch. Usually, the branch will be `main` or `master`, but it could be any branch except for `gh-pages`. If nothing is set for this variable, then the current branch from which `docusaurus deploy` is invoked will be used. |
|
| `CURRENT_BRANCH` | The source branch. Usually, the branch will be `main` or `master`, but it could be any branch except for `gh-pages`. If nothing is set for this variable, then the current branch from which `docusaurus deploy` is invoked will be used. |
|
||||||
|
| `GIT_USER_NAME` | The `git config user.name` value to use when pushing to the deployment repo |
|
||||||
|
| `GIT_USER_EMAIL` | The `git config user.email` value to use when pushing to the deployment repo |
|
||||||
|
|
||||||
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
GitHub enterprise installations should work in the same manner as github.com; you only need to set the organization's GitHub Enterprise host as an environment variable:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue