message: Allow publishing canary action
diff: +/* eslint-disable no-console */
  const cpy = require('cpy');
  const execa = require('execa');
  const { readJSON } = require('fs-extra');
  @@ -5,12 +6,17 @@ const { join } = require('path');
  const tmp = require('tmp-promise');
  (async () => {
  + let repo = 'chromaui/action';
  const { version } = await readJSON(join(__dirname, '../package.json'));
  if (!/^[0-9]+\.[0-9]+\.[0-9]+$/.test(version)) {
  - // eslint-disable-next-line no-console
  + if (version.includes('canary')) {
  + repo = 'chromaui/action-canary';
  + console.info(`Publishing canary action to https://github.com/${repo}`);
  + } else {
  console.warn(`Not publishing action for ${version} because it's a prerelease`);
  return;
  }
  + }
  const { path, cleanup } = await tmp.dir({ unsafeCleanup: true, prefix: `chromatic-action-` });
  const run = (cmd, opts) => execa.command(cmd, { cwd: path, stdio: 'inherit', ...opts });
  @@ -33,7 +39,7 @@ const tmp = require('tmp-promise');
  await run('yarn install --production --no-lockfile');
  await run('git init');
  - await run('git remote add origin git@github.com:chromaui/action.git');
  + await run(`git remote add origin git@github.com:${repo}.git`);
  await run('git add .');
  await run(`git commit -m ${version}`);
  await run('git tag v1');
  