How to use the git-rev-sync.remoteUrl function in git-rev-sync

To help you get started, we’ve selected a few git-rev-sync 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 apollographql / apollo-tooling / packages / apollo / src / git.ts View on Github external
commits && commits.length > 0
          ? commits[0]
          : { authorName: null, authorEmail: null, message: null }
      )
      .catch(() => ({ authorEmail: null, authorName: null, message: null }));

    committer = `${authorName || ""} ${
      authorEmail ? `<${authorEmail}>` : ""
    }`.trim();

    message = commit.message;

    // The remoteUrl call can fail and throw an error
    // https://github.com/kurttheviking/git-rev-sync-js#gitremoteurl--string
    try {
      remoteUrl = git.remoteUrl();
    } catch (e) {
      log(["Unable to retrieve remote url, failed with:", e].join("\n\n"));
    }

    // The ci and pr branches pulled from the ci's environment can be undefined,
    // so we fallback on the git context.
    //
    // See https://github.com/pvdlg/env-ci#caveats for a detailed list of when
    // branch can be undefined
    if (!branch) {
      branch = git.branch([gitLoc]);
    }
  }

  return pickBy(
    {

git-rev-sync

Synchronously get the current git commit hash, tag, or branch

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages