Skip to content

Commit a5c532f

Browse files
Aditya JoshiAditya Joshi
authored andcommitted
DOT-4695 : Added env variable support for current branch and baseline
1 parent a7d90a7 commit a5c532f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

commands/storybook.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ async function storybook(serve, options) {
114114
}
115115

116116
let commit = await getLastCommit();
117+
let baseLine;
118+
if (process.env.BASELINE_BRANCH !== undefined && process.env.BASELINE_BRANCH !== null && process.env.BASELINE_BRANCH !== '') {
119+
baseLine = process.env.BASELINE_BRANCH
120+
}
117121
let payload = {
118122
downloadURL: url.substring(url.search(/.com/)+5, url.search(/.zip/)+4),
119123
uploadId: uploadId,
@@ -126,13 +130,14 @@ async function storybook(serve, options) {
126130
customViewports: storybookConfig.customViewports
127131
},
128132
git: {
129-
branch: commit.branch,
133+
branch: process.env.BRANCH_NAME ? process.env.BRANCH_NAME: commit.branch,
130134
commitId: commit.shortHash,
131135
commitAuthor: commit.author.name,
132136
commitMessage: commit.subject,
133137
githubURL: process.env.GITHUB_URL || '',
134138
},
135-
buildName: buildName
139+
buildName: buildName,
140+
baseline: baseLine?? "",
136141
}
137142

138143
// Call static render API

0 commit comments

Comments
 (0)