Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const ancestorHash =
branch === 'master' ? getAncestorHashForMaster() : getAncestorHashForBranch();
const build = await api.createBuild({
projectId: project.id,
lifecycle: 'unsealed',
hash,
branch,
ancestorHash,
commitMessage: getCommitMessage(hash),
author: getAuthor(hash),
avatarUrl: getAvatarUrl(hash),
externalBuildUrl: getExternalBuildUrl(),
runAt: new Date().toISOString(),
committedAt: getCommitTime(hash),
ancestorCommittedAt: ancestorHash ? getCommitTime(ancestorHash) : undefined,
});
print(`Saving CI project ${project.name} (${project.id})\n`);
print(`Saving CI build (${build.id})\n`);
const lhrs = loadSavedLHRs();
const urlReplacementPatterns = options.urlReplacementPatterns.filter(Boolean);
const targetUrlMap = new Map();
const buildViewUrl = new URL(
`/app/projects/${project.slug}/compare/${build.id}`,
options.serverBaseUrl
);
for (const lhr of lhrs) {
const parsedLHR = JSON.parse(lhr);
const branch = getCurrentBranch();
const ancestorHash =
branch === 'master' ? getAncestorHashForMaster() : getAncestorHashForBranch();
const build = await api.createBuild({
projectId: project.id,
lifecycle: 'unsealed',
hash,
branch,
ancestorHash,
commitMessage: getCommitMessage(hash),
author: getAuthor(hash),
avatarUrl: getAvatarUrl(hash),
externalBuildUrl: getExternalBuildUrl(),
runAt: new Date().toISOString(),
committedAt: getCommitTime(hash),
ancestorCommittedAt: ancestorHash ? getCommitTime(ancestorHash) : undefined,
});
print(`Saving CI project ${project.name} (${project.id})\n`);
print(`Saving CI build (${build.id})\n`);
const lhrs = loadSavedLHRs();
const urlReplacementPatterns = options.urlReplacementPatterns.filter(Boolean);
const targetUrlMap = new Map();
const buildViewUrl = new URL(
`/app/projects/${project.slug}/compare/${build.id}`,
options.serverBaseUrl
);
for (const lhr of lhrs) {