-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Fix] Storybook is failing the build #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
script/publish-storybook
Outdated
| repo: `https://primer-css:${process.env.GH_TOKEN}@github.com/primer/storybook` | ||
| }, (error) => { | ||
| if(error) { | ||
| console.log('gh-pages failed to publish:', error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if any of the possible errors includes the repo URL in it, but just in case could we replace the value of $GH_TOKEN with a placeholder in error.message? E.g.
const {GH_TOKEN} = process.env
const pattern = new RegExp(GH_TOKEN, 'g')
const placeholder = '${GH_TOKEN}'
console.error('gh-pages failed to publish:', error.message.replace(pattern, placeholder))There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we should set process.exitCode = 1 here, otherwise we'll get false positives on Travis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's give it a shot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
When storybook fails to publish the build is failing, This PR is going to address it by catching the error.
@emplums @shawnbot