When manually queuing a multi-stage YAML pipeline, you can specify which stages to include/exclude by deselecting them in Stages. Similarly, the Azure DevOps REST API allows you to accomplish the same thing by specifying the stagesToSkip
in the post BODY..
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.2-preview.1
Body:
{
"stagesToSkip": [
"test",
"uat",
"prod"
]
}
Is there any endpoint that can be used to query which stages were intended for the pipeline run?
Scenarios:
- Suppose I want to programmatically locate all builds that were queued manually but excluded a specific environment?
- Execute a script in the pipeline to determine which future actions will be taken. For example, if I have deselected the Performance-Test stage, i can alter the compilation step. I know I can do this via pipeline variables or parameter inputs, but the “Stages to Run” is an equivalent of user-intent.