Skip to content

Commit

Permalink
Support ownerName prefix in --branch-name flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jan 12, 2021
1 parent d847727 commit 1c178ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/lib/getOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const resolveHomeDir = (filepath) =>
export default async function getOptions({ argv, env, flags, log, packageJson }) {
const fromCI = !!flags.ci || !!process.env.CI;
const [patchHeadRef, patchBaseRef] = (flags.patchBuild || '').split('...').filter(Boolean);
const [branchName, ownerName] = (flags.branchName || '').split(':').reverse();

const options = {
projectToken: takeLast(flags.projectToken || flags.appCode) || env.CHROMATIC_PROJECT_TOKEN, // backwards compatibility
Expand Down Expand Up @@ -64,7 +65,8 @@ export default async function getOptions({ argv, env, flags, log, packageJson })
: undefined,
createTunnel: !flags.storybookUrl && env.CHROMATIC_CREATE_TUNNEL !== 'false',

branchName: flags.branchName,
ownerName,
branchName,
patchHeadRef,
patchBaseRef,
};
Expand Down
2 changes: 1 addition & 1 deletion bin/lib/parseArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function parseArgs(argv) {
Chromatic options
--allow-console-errors Continue running Chromatic even if there are errors logged to console in your Storybook.
--auto-accept-changes [branch] If there are any changes to the build, automatically accept them. Only for [branch], if specified. Globs are supported via picomatch.
--branch-name <branch> Override the branch name. Only meant to be used for unsupported CI integrations and fixing cross-fork PR comparisons.
--branch-name <branch> Override the branch name. Only meant to be used for unsupported CI integrations and fixing cross-fork PR comparisons. Also accepts <owner>:<branch> format.
--exit-once-uploaded [branch] Exit with 0 once the built version has been published to Chromatic. Only for [branch], if specified. Globs are supported via picomatch.
--exit-zero-on-changes [branch] If all snapshots render but there are visual changes, exit with code 0 rather than the usual exit code 1. Only for [branch], if specified. Globs are supported via picomatch.
--ignore-last-build-on-branch <branch> Do not use the last build on this branch as a baseline if it is no longer in history (i.e. branch was rebased). Globs are supported via picomatch.
Expand Down

0 comments on commit 1c178ad

Please sign in to comment.