feat(cmd): release v1.10.0 — shallow clone guard and --check preflight
- refuse to release when the clone is shallow and no previous release tag is found: tags beyond the fetch depth would silently restart versioning at X.Y.0; --allow-shallow bypasses the guard for a true first release - new --check preflight validates the release environment without releasing: branch resolution + pattern, working tree, tag discovery, shallow clone, remote origin URL parse (same parse the push performs), push auth method, version files, release target — all problems reported at once, non-zero exit on failure - .releaser.gitlab-ci.yml gains an optional .releaser:check MR-pipeline job; CI examples now set GIT_DEPTH: 0 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
<img src="docs/static/images/releaser-logo-128.png" alt="releaser logo" width="128">
|
||||
|
||||

|
||||

|
||||
|
||||
A CI-friendly release automation tool for GitFlow workflows using Conventional Commits.
|
||||
|
||||
@@ -69,12 +69,19 @@ releaser --tag-only
|
||||
# CI_COMMIT_BRANCH / CI_COMMIT_REF_NAME / GITHUB_REF_NAME automatically)
|
||||
releaser --branch release/1.2
|
||||
|
||||
# First release from a shallow clone (no previous tag exists yet)
|
||||
releaser --allow-shallow
|
||||
|
||||
# Write changelog to a custom file
|
||||
releaser --changelog-file CHANGES.md
|
||||
|
||||
# Show configuration sources, commit list, and version decision
|
||||
releaser --verbose --dry-run
|
||||
|
||||
# Preflight: validate branch, working tree, remote URL, push auth,
|
||||
# version files, and release target — reports all problems at once
|
||||
releaser --check
|
||||
|
||||
# Target a specific pom.xml
|
||||
releaser --pom path/to/pom.xml
|
||||
|
||||
@@ -178,6 +185,7 @@ release:
|
||||
- if: $CI_COMMIT_BRANCH =~ /^release\/.+$/
|
||||
variables:
|
||||
GITLAB_TOKEN: $RELEASE_TOKEN # project/group CI variable with api + write_repository scope
|
||||
GIT_DEPTH: 0 # full history — shallow clones hide previous release tags
|
||||
script:
|
||||
- releaser
|
||||
artifacts:
|
||||
|
||||
Reference in New Issue
Block a user