Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
fix issue where new repo didn't set matching source branch
Browse files Browse the repository at this point in the history
Merge pull request #87 from stephenhmarsh/source-branch-fix
  • Loading branch information
jimmyandrade authored Jun 15, 2021
2 parents 169d206 + e010556 commit 9d907ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/storybook_to_ghpages
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ if (args.DRY_RUN) {
shell.cd(args.OUTPUT_DIR);
publishUtils.exec('git init');

// if --source-branch specified, it needs to exist in the new repo too
const { SOURCE_BRANCH } = args;
if (!!SOURCE_BRANCH) {
publishUtils.exec(`git checkout -b ${SOURCE_BRANCH}`);
}

// inside this git repo we'll pretend to be a new user
publishUtils.exec(`git config user.name ${JSON.stringify(config.gitUsername)}`);
publishUtils.exec(`git config user.email ${JSON.stringify(config.gitEmail)}`);
Expand Down Expand Up @@ -70,7 +76,7 @@ if (args.CI_DEPLOY) {
}
}

const { SOURCE_BRANCH, TARGET_BRANCH } = args;
const { TARGET_BRANCH } = args;

publishUtils.exec(
`git push --force --quiet ${GIT_URL} ${SOURCE_BRANCH}:${TARGET_BRANCH}`
Expand Down

0 comments on commit 9d907ca

Please sign in to comment.