From 931ef4daa5cc3a60a77fe8f52e4b6274f305d182 Mon Sep 17 00:00:00 2001 From: DominikStypulaPolcode <54673942+dominik-stypula-polcode@users.noreply.github.com> Date: Thu, 11 Feb 2021 09:54:08 +0100 Subject: [PATCH] fix: make it possible to deploy from SOURCE_BRANCH --- bin/storybook_to_ghpages | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/storybook_to_ghpages b/bin/storybook_to_ghpages index 6650087..d4bd482 100755 --- a/bin/storybook_to_ghpages +++ b/bin/storybook_to_ghpages @@ -45,6 +45,12 @@ publishUtils.exec(`git config user.email ${JSON.stringify(config.gitEmail)}`); // disable GPG signing publishUtils.exec('git config commit.gpgsign false'); +// check if source branch argument is set, and checkout to it +if(args.SOURCE_BRANCH) { + publishUtils.exec(`git checkout -b ${JSON.stringify(args.SOURCE_BRANCH)}`); + console.log(`=> Deploying from source branch: ${JSON.stringify(args.SOURCE_BRANCH)}`); +} + // The first and only commit to this new Git repo contains all the // files present with the commit message "Deploy to GitHub Pages". publishUtils.exec('git add .');