Tag
tag
GitTagTool — one-shot semver tag: preflight + compute + create + verify + push.
GitTagTool
Bases: AXMTool
Create a semver release tag in one call.
Performs preflight checks (clean tree, CI status), computes the next version from Conventional Commits, creates an annotated tag, verifies hatch-vcs resolution, and pushes to origin.
Registered as git_tag via axm.tools entry point.
Source code in packages/axm-git/src/axm_git/tools/tag.py
| Python | |
|---|---|
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', version=None, **kwargs)
Create and push a semver tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root (required). |
'.'
|
version
|
str | None
|
Version override (optional, e.g. |
None
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with tag, version, and push status. |
Source code in packages/axm-git/src/axm_git/tools/tag.py
| Python | |
|---|---|
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
check_ci(path)
Check CI status via gh for the CI run matching HEAD.
Returns one of green/red/pending/skipped/error. The status is derived
from the run whose headSha matches the current HEAD SHA, never from
runs[0] unconditionally: a stale green (HEAD moved past it) or a red
on an unrelated commit must not influence the verdict. When no run
matches HEAD, returns pending (block tagging until CI exists for the
exact commit being tagged).
Source code in packages/axm-git/src/axm_git/tools/tag.py
get_tag_prefix(path)
Read tag prefix from pyproject.toml tag-pattern (e.g. git/).
Returns the prefix string (e.g. "git/") or "" if none.
Source code in packages/axm-git/src/axm_git/tools/tag.py
resolve_version(version_override, current_tag, commits, *, tag_prefix='')
Resolve the next version tag.
Returns:
| Type | Description |
|---|---|
tuple[str, str, bool]
|
|
Source code in packages/axm-git/src/axm_git/tools/tag.py
verify_hatch_vcs(path, pkg_name)
Rebuild package and read resolved version (best-effort).