Adds Jira issue key as a tag in commit messages if a Jira key is found in the branch's name.
Add the following to the .pre-commit-config.yaml file in you repo.
- repo: https://github.com/ESSS/add-jira-tag-pre-commit
rev: v0.2.0
hooks:
- id: add-jira-tag
name: add-jira-tag
stages: [ prepare-commit-msg ] Then, install pre-commit hooks (usually pre-commit install).
⚠️ add-jira-tagis aprepare-commit-msghook, so passing additional arguments--install-hooks -t prepare-commit-msgmay be required during hooks installation.
Run tests with:
uv run --with pytest pytestTo use this hook during development of this repo, with pre-commit:
uv run --with pre-commit pre-commit install -t prepare-commit-msgor with prek:
uv run --with prek prek install -t prepare-commit-msg