Skip to content

Commit

Permalink
Add check for AgentJobStatus in azdo-task post step
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartleeks committed Jun 27, 2021
1 parent 6855c8e commit c06fd36
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions azdo-task/DevContainerBuildRun/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,18 @@ async function runMain(): Promise<void> {
}

async function runPost(): Promise<void> {
// buildReasonsForPush
//sourceBranchFilterForPush

// TODO - check AGENT_JOBSTATUS env var:
// https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
const agentJobStatus = process.env.AGENT_JOBSTATUS
switch (agentJobStatus) {
case "Succeeded":
case "SucceededWithIssues":
// continue
break;

default:
console.log(`Image push skipped because Agent JobStatus is '${agentJobStatus}'`)
return;
}

const buildReasonsForPush: string[] =
task.getInput('buildReasonsForPush')?.split('\n') ?? []
Expand Down

0 comments on commit c06fd36

Please sign in to comment.