You want a published release and deployment to start whenever someone pushes a version tag.
BeginnerScenarioBranching Strategies and Releases
Answer
Situation read → The tag becomes the release trigger.
What I'd do →
- Workflow trigger on tags:
on:
push:
tags: ['v*.*.*']
- Build the artifact, tag the image with the tag name and commit SHA.
- Create the GitHub release:
gh release create "$GITHUB_REF_NAME" --generate-notes. - Protect
v*tags so only maintainers can create them.
Why → The pipeline is reproducible from a tag alone, and humans only decide when to tag.
Interview tip → Mention that tag creation permission is effectively release permission.
More on Branching Strategies and Releases
An eight-person team deploys several times a day. Which branching strategy do you recommend?IntermediateWhen would you choose GitFlow over trunk-based development?IntermediateIn trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?IntermediateYou are cutting a release. How do you manage the release branch and late fixes?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?Intermediate