Skip to content

Conversation

@jonrohan
Copy link
Member

@jonrohan jonrohan commented Jul 3, 2018

When storybook fails to publish the build is failing, This PR is going to address it by catching the error.

@emplums @shawnbot

repo: `https://primer-css:${process.env.GH_TOKEN}@github.com/primer/storybook`
}, (error) => {
if(error) {
console.log('gh-pages failed to publish:', error)
Copy link
Contributor

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))

Copy link
Contributor

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.

@jonrohan jonrohan mentioned this pull request Jul 3, 2018
9 tasks
@jonrohan jonrohan changed the base branch from release-10.8.0 to release-10.7.1 July 3, 2018 17:20
@jonrohan jonrohan changed the base branch from release-10.7.1 to master July 3, 2018 17:23
Copy link
Contributor

@shawnbot shawnbot left a 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!

Copy link
Contributor

@emplums emplums left a 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!

@jonrohan jonrohan merged commit 4158c22 into master Jul 3, 2018
@jonrohan jonrohan deleted the fix_storybook branch July 3, 2018 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants