When using Git source control system, the tag mechanism is one of good practice in great DevOps pipeline.

In VSTS (Visual Studio Team Services) build process, the Tag action option is present by default when the source repository is Git type.

tag source

What we can notice that this option is not present if the source repository is GitHub type.

To allow me to tag my GitHub source code I developed and published an extension in the Visual Studio Marketplace, which through a build/release task will tag my source code.

This extension named ‘GitHub Tools Tasks’ is available in the VSTS Marketplace

marketplace

Tag your source code

In your VSTS build process add the task “Tag GitHub source code” from the Utility category

task

Select or create a GitHub connection end point [1], if your build sources repository is GitHub, the GitHub service end point has already been created.

Choose the repository [2] and input the desired Tag [3] for example v$(Build.BuildNumber) for tag your code with the current build number.

After the build execution you can see the tag in your GitHub code

github tag

In my next blog post I will present the 2nd task of this extension for create Release of your GitHub source code from VSTS pipeline.