Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(tl.loc("DefinitionNameMatchFound", definitionIdSpecified, definitionId));
}
if (!definitionId) {
reject(tl.loc("UnresolvedDefinitionId"));
return;
}
}
// verify that buildId belongs to the definition selected
if (definitionId) {
var build: Build;
if (buildVersionToDownload != "specific" && !triggeringBuildFound) {
var resultFilter = BuildResult.Succeeded;
if (allowPartiallySucceededBuilds) {
resultFilter |= BuildResult.PartiallySucceeded;
}
var branchNameFilter = (buildVersionToDownload == "latest") ? null : branchName;
// get latest successful build filtered by branch
var buildsForThisDefinition = await executeWithRetries("getBuildId", () => buildApi.getBuilds(projectId, [parseInt(definitionId)], null, null, null, null, null, null, BuildStatus.Completed, resultFilter, tagFilters, null, null, null, null, null, BuildQueryOrder.FinishTimeDescending, branchNameFilter), retryLimit).catch((reason) => {
reject(reason);
return;
});
if (!buildsForThisDefinition || buildsForThisDefinition.length == 0) {
if (buildVersionToDownload == "latestFromBranch") reject(tl.loc("LatestBuildFromBranchNotFound", branchNameFilter));
else reject(tl.loc("LatestBuildNotFound"));
return;
}
build = buildsForThisDefinition[0];