Forum Discussion

mdanyliuk's avatar
mdanyliuk
Copper Contributor
Jul 19, 2023

Change reject logic for the pipelines

Hi,
Why rejection in approvals has the same logic as failure?

I have a  pipeline with multiple stages/jobs and I want to add a manual approval step for some of the jobs in the middle of this sequence. In some case, I need to reject the next job but I don't want to fail the whole pipeline, it's not logical.
At the same time if the job has some conditions that are not correct this job will be skipped, not failed.

1 Reply

  • In Azure Pipelines, when a manual approval is rejected, the system treats it as a terminal failure for that stage. This is by design, as approvals are considered checks that must pass before a stage can execute. If a check fails (like a rejected approval), the stage is blocked and the pipeline halts.
    This behavior is consistent across platforms like AWS CodePipeline too, where rejection causes the pipeline to enter a "Failed" state.

     

    Would suggest using conditions to skip jobs:

     

    condition: and(succeeded(), eq(variables['ManualApproval'], 'Approved'))

     

    Environments with checks

    Approvals are often tied to environments. You can configure checks so that rejection prevents stage execution without failing the entire pipeline. The pipeline pauses, and if the check isn’t satisfied, the stage is skipped.

Resources