Skip to content
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

Honor --branch-name when using GitHub Action and other cases #452

Open
ghengeveld opened this issue Nov 15, 2021 · 4 comments
Open

Honor --branch-name when using GitHub Action and other cases #452

ghengeveld opened this issue Nov 15, 2021 · 4 comments
Labels

Comments

@ghengeveld
Copy link
Member

Currently, the GitHub Action does not take a branchName option. Similarly, when using a build script that sets GITHUB_EVENT_NAME=pull_request or when using Travis, the --branch-name flag is overruled. The --branch-name flag should take precedence.

@svallory
Copy link

Adding branchName to chromatic.config.json gives the following error when running npx chromatic

Error: ✖ Configuration file chromatic.config.json was invalid, please check the allowed keys.

- Unrecognized key(s) in object: 'branchName'

@ghengeveld
Copy link
Member Author

ghengeveld commented May 24, 2024

@svallory Setting a branchName via the config file does not make sense, as this would force one single branch name for all builds regardless of the actual current branch name. This is almost guaranteed to be a footgun so this is an option that likely will never be added to the config file.

This ticket is about supporting the branchName input value for the GitHub action, similar to the —-branch-name flag. Both of these are configurable on a case-by-case basis (i.e. on individual builds) so it makes sense to have them. Only the flag is supported right now.

@svallory
Copy link

Thank you for the explanation, @ghengeveld! I'm new to chromatic and took a quick look through the documentation but couldn't find out a quick summary of how it works and its relationship to git. I imagined that the branch name would make sure chromatic only runs for that branch.

It looks like I'll have to read a lot to build a mental model of it, so I'll get back to it later. Especially because I can use storybook just fine in dev, but chromatic says the storybook build failed without telling me why. All it says is "Invalid Storybook build at /var/folders/qz/45zwvmpd5j30jvp9_frhdf3r0000gn/T/chromatic--37818-vHcZvIoW265V (check the build log)". Fine, but what log? There's no log file in that folder.

Anyway, thank you for the info!

@ghengeveld
Copy link
Member Author

@svallory That’s understandable. We have many options that take a branch name value. If you want to disable or enable Chromatic on specific branches, you’re looking for the skip option. This one you can specify in the config file. See also https://www.chromatic.com/docs/custom-ci-provider/#skipping-builds-for-certain-branches

The Storybook build log usually ends up in the build directory mentioned. If you continue to have problems, please reach out to our support team via the chat bubble in our webapp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants