Skip to content

Commit

Permalink
feat:Enhance the deploy command to enable the setting of git user.nam…
Browse files Browse the repository at this point in the history
…e and user.email in deployment branch (facebook#9101)
  • Loading branch information
amdshrif committed Jun 25, 2023
1 parent ae2a093 commit b999249
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/docusaurus/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ This behavior can have SEO impacts and create relative link issues.

const gitUser = process.env.GIT_USER;




let useSSH =
process.env.USE_SSH !== undefined &&
process.env.USE_SSH.toLowerCase() === 'true';
Expand Down Expand Up @@ -215,6 +218,16 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
}
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 =
process.env.CUSTOM_COMMIT_MESSAGE ??
`Deploy website - based on ${currentCommit}`;
Expand Down

0 comments on commit b999249

Please sign in to comment.