trigger:
- production

pool:
  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
   XXX
  
- script: |
    XXX

- script: |
    XXX

- script: |
    XXX

- task: CopyFiles@2
    XXX

- task: PublishBuildArtifacts@1
    XXX

Solution 1:

Add a trigger for master branch only. When a PR into master completes, a commit will be added to master and will trigger your yaml pipeline.

trigger:
- master

https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#ci-triggers