Interview Prep/Git & GitHub/Protection, Hooks and Policy

You must stop people from deleting or moving release tags.

IntermediateScenarioProtection, Hooks and Policy
Answer

Situation read → Tags are release identity and must be immutable.

What I'd do →

  1. Create a ruleset targeting tags with pattern v*.
  2. Enable "Restrict deletions" and "Restrict updates" ("Block force pushes").
  3. Allow creation only for release managers or the release bot.
  4. Verify by trying git push --delete origin v1.0.0 from a test account.

Why → Anyone who can move a tag can change what "v1.0.0" means in production.

Interview tip → Legacy tag protection rules were replaced by rulesets.

All Git & GitHub questions Roadmap: Git & GitHub

More on Protection, Hooks and Policy