Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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(
{