CICD-008 · Trigger on version tags
Encyclopedia · Events and triggers · All snippets
Previous · CICD-007 · Next · CICD-009
1. Where it fits
- Placement .github/workflows/ci.yml, at workflow level, or within jobs for a named job mapping.
- Prerequisites workflow on an example repository with main as default.
- Platforms github-actions, gitea-actions.
2. Copy the snippet
yaml
on:
push:
tags: ["v*"]3. How it works
A version tag is a separate Git ref. This trigger matches tag pushes and does not validate the tag's contents, creator, or commit.
4. Verify the result
Use a protected tag namespace and validate its SemVer separately.
Watch for. Place event filters at workflow scope and test an event that should run and an event that should be skipped.
Validation syntax-validated (YAML parse). Status definitions.