Validates release tags against RIP 0007.
Only MAJOR.MINOR.MICRO release tags are accepted.
Add the hook to .pre-commit-config.yaml:
repos:
- repo: https://github.com/RidgeRun/pre-commit-rip0007-versioning-standard
rev: main
hooks:
- id: rip0007-versioning-standardRun the configured hooks for every tag pipeline:
validate-version-tag:
stage: validate
image: python:3.12-slim
rules:
- if: '$CI_COMMIT_TAG'
before_script:
- apt-get update
- apt-get install --yes git
- python -m pip install --upgrade pip pre-commit
script:
- pre-commit run --all-filesGitLab supplies the pushed tag as CI_COMMIT_TAG. The hook validates that
value in CI and skips non-tag pipelines. Do not install this hook locally:
Git does not provide a tag-creation hook, and pre-commit cannot reliably
validate a pushed release tag.