async function getLatestBuild()

in frontend/app/getbuilds.ts [88:111]


async function getLatestBuild(
  deploymentInfo: DeployedImageInfo,
  branchName: string
) {
  const maybeProjectId =
    getGLProjectId(deploymentInfo) ?? getGHProjectId(deploymentInfo);
  if (!maybeProjectId) {
    console.log(
      `${deploymentInfo.deploymentName}: can't get build info because there is no gitlab-project-id set in the labels`
    );
    return;
  }

  const jobName =
    getGLPublishingJob(deploymentInfo) ?? getGHPublishingJob(deploymentInfo);
  if (!jobName) {
    console.log(
      `${deploymentInfo.deploymentName}: can't get build info because there is not gitlab-publishing-job set in the labels`
    );
    return;
  }

  return getLatestBuildInternal(maybeProjectId, jobName, branchName);
}