You correctly removed the pr: block from your YAML. This is the best practice. PR builds should be controlled by Branch Policies in the Azure DevOps UI, as this is more secure and explicit.
If your PRs are not triggering, it's because this UI setting is missing:
- Go to Repos > Branches.
- Find your
developbranch, click the ... menu, and select Branch policies. - Under "Build Validation," click the + button.
- Select your main "Assembly Line" pipeline (e.g.,
ODB pipeline). - Set the trigger to Automatic and the requirement to Required.
- Click Save and repeat for your
mainbranch.
This policy, not your YAML, is now the "source of truth" for PR builds. Your Deploy stage's condition (ne(variables['Build.Reason'], 'PullRequest')) will automatically detect this is a "PullRequest" build and skip deployment.