fix(client/go): correct tag-go-module dirty-tree guard; GOPRIVATE docs (Client.Go-028,029)

This commit is contained in:
Joseph Doherty
2026-06-15 02:39:11 -04:00
parent fb2b1a4a52
commit d0d1dcef15
3 changed files with 96 additions and 8 deletions
+8 -4
View File
@@ -39,10 +39,14 @@ if ($Version -notmatch '^v\d+\.\d+\.\d+(-[A-Za-z0-9.-]+)?$') {
$tag = "clients/go/$Version"
Write-Host "Creating Go-module tag: $tag" -ForegroundColor Cyan
# Verify we're on a clean checkout — refuse to tag with uncommitted changes.
$status = (git status --porcelain) -join "`n"
if ($status -and -not ($status -match '^\?\?')) {
throw "Working tree has tracked changes. Commit or stash before tagging."
# Verify we're on a clean checkout — refuse to tag with uncommitted tracked
# changes. Test each porcelain line individually: any entry that is not an
# untracked file (`??`) is a tracked change, regardless of how the entries
# happen to sort. Joining and anchoring `^\?\?` against the whole blob would
# only inspect the first line and miss tracked changes behind an untracked one.
$dirty = (git status --porcelain) | Where-Object { $_ -and ($_ -notmatch '^\?\?') }
if ($dirty) {
throw "Working tree has tracked changes. Commit or stash before tagging.`n$($dirty -join "`n")"
}
# Verify the tag doesn't already exist.