Azure-devops-docs: Triggering a build on new branch/tag added

Created on 29 Oct 2018  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

Right now, no build seems to be triggered when a new branch or tag is pushed to a Github repository. #1876 seemed to point towards new tags triggering new builds, but I am getting new builds only when new commits are pushed to already existing branches.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Most helpful comment

Hi @vytis, we made a change today, and this should be working now. Please let me know if it's not. Thanks!

All 8 comments

I would be interested in this as well - at the moment it just doesn't get triggered when even with trigger: refs/tags* added to azure-pipelines.yml

Hi @vytis, we made a change today, and this should be working now. Please let me know if it's not. Thanks!

Seems to work on my end :+1:

Same here!

Thanks for your reports and patience on this, @vytis and @LaurentTreguier! I'm closing this now, but please reopen this issue if we can provide additional help.

We are seeing some issues with triggering builds from tags - sometimes nothing happens, sometimes it all works fine. For example we have pushed a commit that triggered this build, then pushed a tag immediately afterwards but nothing happened. However when I manually deleted and re-added the same tag all worked fine and this build got triggered

I'd like to trigger a build pipeline when a repo is tagged only; i.e. without requiring new commits (although I'd also like to trigger a build when new commits are pushed).

According to the sprint 143 release notes I should be able to use the following:

trigger:
  tags:
    include:
    - releases/*
    exclude:
    - releases/old*

... but the yaml schema reference doesn't mention tags and a post above uses a branch reference of refs/tags/* instead.

So it looks like tags aren't supported, as a separate item, and the following shorthand should suffice?

trigger:
- master
- refs/tags/*

This documentation is still wrong and misleading.

YAML builds are configured by default with a CI trigger on all branches and all tags.

This statement is incorrect.

In order to build all tags, this must be added to the azure-pipelines.yml:

trigger:
  tags:
    include: ['*']

However, if you add only this, it makes it so that ONLY tags are built. So, to get all tags and all branches to build, you need this:

trigger:
  branches:
    include: ['*']
  tags:
    include: ['*']

Please update the docs or make it so that new tags are built by default to match the documentation.

Was this page helpful?
0 / 5 - 0 ratings