I am looking to implement a automated SemVer process.
Lets say I have a PR open which has the label/tag of major, is there anyway to retrieve this tag AFTER it has been merged to main?
When the PR gets merged to main, I want to then trigger a pipeline which reads the label and then automatically bumps the tag version on the repo, is this possible in Azure DevOps? I know this can be done in GitHub.
We can use the two REAT API Pull Request Labels - Get and Annotated Tags - Create to complete the process.
The following is my test steps:
PATwith the Personal Access Token in the pipeline.The pipeline has a condition in the job, so the job will only run when the
Build.SourceVersionMessagecontains the words "Merged PR". If not, the job will be skipped.Then we use the REST API in the PowerShell script to get the tag value from the PR and add tag to the branch.
Test Result: