0
votes

I have two stage pipeline where the second (deployment) stage requires environment with approval. If no one approves the deployment - the build fails after the timeout (30 days max configurable in env approvals) on the approval. This causes weird emails about failed builds from past as the timeout triggers the build failed email to be sent.

Is there anyway to not fail the build when the approval times out?

1
Looks like there is a feature on the roadmap to mark the stage as skipped in the case of the approval timeout. developercommunity.visualstudio.com/idea/833201/…. Although I wonder if you could loop through the pending approvals with the API or CLI and cancel any runs at timeout-1 day.Eric Smith
How about the issue? Does the answer below resolved your question, If yes, you could accept it as an answer, so it could help other community members who get the same issues and we could archive this thread, thanks. If not, please let us know if you would like further assistance.Leo Liu-MSFT

1 Answers

1
votes

Azure Devops pipeline fails when stage not approved

Indeed, just like Eric comment, this is a feature on the roadmap to mark the stage as skipped in the case of the approval timeout. The run will be marked successful and no failure email would be raised. Will keep you updated as we make progress.

You could vote and add your comments for this feedback. When there are enough communities vote and add comments for this feedback.

Besides, MS provided advanced approval options to configure approval policies in sprint 160 before we fully get this feature:

You can now use advanced approval options to configure approval policies like requester should not approve, require approval from a subset of users and approval timeout.

enter image description here

Hope this helps.