How to use the shipjs-lib.getRepoInfo function in shipjs-lib

To help you get started, we’ve selected a few shipjs-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / shipjs / packages / shipjs / src / step / release / createGitHubRelease.js View on Github external
assetsToUpload,
        dir,
        version,
        tagName,
      });

      if (dryRun) {
        print('Creating a release with the following:');
        print(`  - content: ${content}`);
        if (assetPaths.length > 0) {
          print(`  - assets: ${assetPaths.join(' ')}`);
        }
        return;
      }

      const { owner, name: repo } = getRepoInfo(remote, dir);

      const octokit = new Octokit({
        auth: `token ${process.env.GITHUB_TOKEN}`,
      });

      const {
        data: { upload_url }, // eslint-disable-line camelcase
      } = await octokit.repos.createRelease({
        owner,
        repo,
        tag_name: tagName, // eslint-disable-line camelcase
        name: tagName,
        body: content,
      });

      if (assetPaths.length > 0) {
github algolia / shipjs / packages / shipjs / src / step / release / gatherRepoInfo.js View on Github external
runStep({ title: 'Gathering repository information.' }, () => {
    const appName = getAppName(dir);
    const latestCommitHash = getLatestCommitHash(dir);
    const latestCommitUrl = getCommitUrl(remote, latestCommitHash, dir);
    const { url: repoURL } = getRepoInfo(remote, dir);
    const releaseTag = getReleaseTag(version);

    return {
      appName,
      version,
      latestCommitHash,
      latestCommitUrl,
      repoURL,
      releaseTag,
    };
  });
github algolia / shipjs / packages / shipjs / src / step / prepare / createPullRequest.js View on Github external
) {
      print(warning('You want to release using a dedicated release branch.'));
      print(
        warning(
          `The name of the branch is \`${destinationBranch}\`, but you don't have it yet.`
        )
      );
      print(warning('Create that branch pointing to a latest stable commit.'));
      print(warning('After that, try again.'));
      print('');
      print(warning('Rolling back for now...'));
      run({ command: `git checkout ${baseBranch}`, dir, dryRun });
      run({ command: `git branch -D ${stagingBranch}`, dir, dryRun });
      exitProcess(0);
    }
    const { url: repoURL, owner, name: repo } = getRepoInfo(remote, dir);
    const publishCommandInStr = getPublishCommandInStr({
      isYarn: detectYarn(dir),
      tag: getReleaseTag(nextVersion),
      monorepo,
      publishCommand,
      dir,
    });
    const title = formatPullRequestTitle({ version: nextVersion, releaseType });
    const message = formatPullRequestMessage({
      formatPullRequestTitle,
      repoURL,
      baseBranch,
      stagingBranch,
      destinationBranch,
      mergeStrategy,
      currentVersion,