skip to Main Content

I’m currently writing some custom pipelines for my team to enforce our versioning, commit & merge strategy standards, such as:

  • Conventional Commit formatting on the merge commit
  • Enforcing squash commits when merging in bug fixes and features
  • etc

Is there a way to trigger this pipeline to run when a pull requests title is updated?

The workflow at the moment is quite strict:
When a dev creates their PR, it runs this pipeline automatically ensuring their PR title is correctly formatted, which then fails because:

  1. The PR auto-complete policy wouldn’t be set, meaning the merge commit and merge strategies are null when hitting the Azure Pull Request REST API
  2. The developer then needs to correct this and manually re-queue the pipeline

If their PR title is incorrect to begin with, they also need to re-run this pipeline.

Is this something that can be achieved?

Looking at the Azure Trigger Types I don’t see anything immediately.

2

Answers


  1. On Azure DevOps, currently it is not supported to trigger the pipeline when the PR title changed event occurs.

    The PR triggers on Azure DevOps can only support below events:

    • A PR is opened.
    • Some new changes pushed to the source branch of the opening PR.
    Login or Signup to reply.
  2. There is no way to trigger a pipeline automatically upon a PR title change. But I would like to suggest you to go with a comment trigger. Since developers anyway need to update the title, they can put a comment to the PR at the same time. That can trigger the pipeline with a minimum manual effort. Following comments can be used.

    /azp run
    /azp run <pipeline-name>
    

    or

    /AzurePipelines run
    /AzurePipelines run <pipeline-name>
    

    P.S. The one who comments on the PR should have at least write access on the repository to trigger the pipeline.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search