Case: I have a azure Devops pipeline which deploys code to PRODDUCTION. It takes tag name (tag created by developer on master branch commit) as input, so that it can deploy only that specific version of code from master branch. This pipeline is set as no auto trigger, developers tag the commit in master branch & given that tag name to operation team to enter it as run time parameter (input to the pipeline)
I check out code using checkout steps with in deploy job of azure devops pipeline.
deploy:
steps:
- checkout: git://MY_PROJECT/MY_REPO@refs/tags/${{variables.tag_name}}
Query: How to assure (before deployment) that this tag is from master branch only and not from other non-master branches. (developers can create tag on master branch also)
I know we can use script like 'git commit --contains' & 'git describe' but how can we handle it efficiently any suggestion and best practices around this.