fix(monorel): bump tags the latest commit touching the module, not HEAD

In a monorepo the module's most recent commit is often behind HEAD
(other modules may have been committed on top).

  git log --format=%H -1 -- .

run from the module root returns the SHA of the last commit that
touched that directory; we pass it explicitly to `git tag <tag> <sha>`
instead of letting git default to HEAD.
This commit is contained in:
AJ ONeal 2026-02-28 11:48:17 -07:00
parent b1be4ce829
commit ae46430b7b
No known key found for this signature in database

View File

@ -292,7 +292,13 @@ func bumpModuleTag(group *moduleGroup, component string) string {
} }
newTag := computeBumpTag(prefix, latestStable, component) newTag := computeBumpTag(prefix, latestStable, component)
mustRunIn(modRoot, "git", "tag", newTag) // Tag the most recent commit that touched this module's directory, which
// may be behind HEAD if other modules have been updated more recently.
commitSHA := mustRunIn(modRoot, "git", "log", "--format=%H", "-1", "--", ".")
if commitSHA == "" {
fatalf("no commits found in %s", modRoot)
}
mustRunIn(modRoot, "git", "tag", newTag, commitSHA)
return newTag return newTag
} }