Forum Discussion

mark-jones's avatar
mark-jones
Copper Contributor
Jun 21, 2023

How to make an azure devops pipeline check that a feature branch is update to date with develop?

Does anyone know if its possible to have an azure devops pipeline check that a feature branch is up-to-date with a deploy branch, e.g Develop? I know this is possible with Github pipelines, but could someone tell me if this is feasible in Azure pipelines and how I would do this.  Thank you for your help.

1 Reply

  • How about this, to check for merge base difference:

     

    steps:
    - script: |
        git fetch origin develop
        BASE=$(git merge-base HEAD origin/develop)
        if [ "$BASE" != "$(git rev-parse origin/develop)" ]; then
          echo "Your branch is not up-to-date with develop."
          exit 1
        else
          echo "Branch is up-to-date with develop."
        fi
      displayName: 'Check if branch is up-to-date with develop'

     

Resources