Skip to content

Commit 812a30b

Browse files
yns88yangshun
authored andcommitted
misc(v2): v1 backward compatibility for USE_SSH env var (#1880)
* misc(v2): address comments * misc(v2): update CHANGELOG
1 parent 421598e commit 812a30b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG-2.x.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Convert sitemap plugin to TypeScript.
88
- Significantly reduce main bundle size and initial HTML payload on production build. Generated JS files from webpack is also shorter in name.
99
- Refactor dark toggle into a hook.
10+
- Changed the way we read the `USE_SSH` env variable during deployment to be the same as in v1.
1011

1112
## 2.0.0-alpha.31
1213

packages/docusaurus/src/commands/deploy.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ export async function deploy(siteDir: string): Promise<void> {
6767
process.env.GITHUB_HOST || siteConfig.githubHost || 'github.com';
6868

6969
const useSSH = process.env.USE_SSH;
70-
const remoteBranch = useSSH
71-
? `git@${githubHost}:${organizationName}/${projectName}.git`
72-
: `https://${gitUser}@${githubHost}/${organizationName}/${projectName}.git`;
70+
const remoteBranch =
71+
useSSH && useSSH.toLowerCase() === 'true'
72+
? `git@${githubHost}:${organizationName}/${projectName}.git`
73+
: `https://${gitUser}@${githubHost}/${organizationName}/${projectName}.git`;
7374

7475
// Check if this is a cross-repo publish
7576
const currentRepoUrl = shell

0 commit comments

Comments
 (0)