Skip to content

Make Azure DevOps pipeline conditions cancellable - #50428

Draft
Mike Harder (mikeharder) with Copilot wants to merge 2 commits into
mainfrom
copilot/update-conditions-in-pipelines
Draft

Mike Harder (mikeharder) with Copilot wants to merge 2 commits into
mainfrom
copilot/update-conditions-in-pipelines

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Azure DevOps conditions without explicit status checks may continue running after cancellation. This change adds cancellation-aware guards to executable condition: blocks across the repository.

Changes

  • Added succeeded() to conditions that should run only after successful predecessors.
  • Replaced always() with succeededOrFailed() for cleanup, diagnostics, and artifact publishing.
  • Preserved caller-supplied failure behavior while preventing execution after cancellation.
  • Left non-executable condition parameter defaults unchanged.
condition: and(succeeded(), ne(variables['Skip.Test'], 'true'))

condition: and(succeededOrFailed(), failed())

Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
31 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@mikeharder

Copy link
Copy Markdown
Member

Copilot: revert any lines where the "before" condition included "always()" or "failed()"

1 similar comment
@mikeharder

Copy link
Copy Markdown
Member

Copilot: revert any lines where the "before" condition included "always()" or "failed()"

Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants