Git tag at the end of build on Visual Studio Online (Build vNext, hosted pool) Git tag at the end of build on Visual Studio Online (Build vNext, hosted pool) powershell powershell

Git tag at the end of build on Visual Studio Online (Build vNext, hosted pool)


To answer the question (or better the title of the question).Just let the vNext build do it.

enter image description here

As mentioned in the comments, this is not available for external git repositories.


I'm answering myself on what I was trying to do (git tag was one of the few tasks I wanted to do). It's now possible to execute git commands in scripts. The documentation is here :https://www.visualstudio.com/en-us/docs/build/scripts/git-commands

Here is the howto:

Enable scripts to run Git commands

Grant version control permissions to the build service:

  • Go to the Version Control control panel tab ▼
  • On the Version Control tab, select the repository in which you want to run Git commands, and then select Project Collection Build Service.
  • Grant permissions needed for the Git commands you want to run.

Typically you'll want to grant:

  • Branch creation: Allow
  • Contribute: Allow
  • Read: Inherited allow
  • Tag creation: Inherited allow

When you're done granting the permissions, make sure to click Save changes.

Enable your build definition to run Git.exe

On the variables tab set this variable: system.prefergit to true

On the options tab select Allow scripts to access OAuth token.