How to skip Build without creating Drop and not triggering Release in Azure DevOps
Try and add a Stage condition to only run that stage for a specific branch.
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))


stages:
- stage: A
             .....

- stage: B
  **condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))**
  jobs:
  - job: B1
    steps:
      - script: echo Hello Stage B!
      - script: echo $(isMain)

Reference : https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&amp;tabs=yaml
PS : Will refine the answer in future, currently we are still using GUI for releases and we are using this branch filter to control this scenario.