Skip to content

Commit 25ab7b1

Browse files
Aditya JoshiAditya Joshi
authored andcommitted
Added fallback balues
1 parent f50e3b3 commit 25ab7b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

commands/storybook.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async function storybook(serve, options) {
129129

130130
console.log(`Baseline branch set to: ${baseLine}`)
131131
if(process.env.CURRENT_BRANCH !== null && process.env.CURRENT_BRANCH !==undefined){
132-
if(process.env.BASELINE_BRANCH === ''){
132+
if(process.env.CURRENT_BRANCH === ''){
133133
const error = {
134134
"error": "MISSING_BRANCH_NAME",
135135
"message": "Error : The current branch name environment variable cannot be empty."
@@ -150,12 +150,12 @@ async function storybook(serve, options) {
150150
customViewports: storybookConfig.customViewports
151151
},
152152
git: {
153-
branch: process.env.CURRENT_BRANCH ? process.env.CURRENT_BRANCH: commit.branch,
153+
branch: process.env.CURRENT_BRANCH || commit.branch|| '',
154+
baselineBranch: process.env.BASELINE_BRANCH || '',
154155
commitId: commit.shortHash,
155156
commitAuthor: commit.author.name,
156157
commitMessage: commit.subject,
157158
githubURL: process.env.GITHUB_URL || '',
158-
baselineBranch : baseLine ?? ""
159159
},
160160
buildName: buildName,
161161
}

0 commit comments

Comments
 (0)