@@ -9,28 +9,13 @@ trap 'echo "${BASH_SOURCE[0]}: line $LINENO: $BASH_COMMAND: exitcode $?"' ERR
99REPO_ROOT=" $( git rev-parse --show-toplevel) "
1010cd " $REPO_ROOT "
1111
12- # --- Guard: only run on the default branch ---
13- DEFAULT_BRANCH=" $( git symbolic-ref -q --short refs/remotes/origin/HEAD 2> /dev/null || true) "
14- DEFAULT_BRANCH=" ${DEFAULT_BRANCH# origin/ } "
15- if [[ -z " $DEFAULT_BRANCH " ]]; then
16- # In GitHub Actions, origin/HEAD is often not set; use the API instead
17- DEFAULT_BRANCH=" $( gh repo view --json defaultBranchRef --jq ' .defaultBranchRef.name' 2> /dev/null || true) "
18- fi
19- if [[ -z " $DEFAULT_BRANCH " ]]; then
20- echo >&2 " Error: Unable to determine default branch."
21- exit 1
22- fi
23-
24- CURRENT_BRANCH=" $( git rev-parse --abbrev-ref HEAD) "
25- if [[ " $CURRENT_BRANCH " != " $DEFAULT_BRANCH " ]]; then
26- echo " Not on default branch ($DEFAULT_BRANCH ), skipping. Current: $CURRENT_BRANCH "
27- exit 0
28- fi
12+ # Note: branch guard is handled by the CI workflow (github.ref == 'refs/heads/main').
13+ # Do not duplicate it here — detached-HEAD checkouts in CI break git-based detection.
2914
3015# --- Read current version ---
3116CURRENT_VERSION=$( awk -F' "' ' /^readonly VERSION="[0-9.]*"/ {print $2; exit}' ./sv)
3217if [[ -z " $CURRENT_VERSION " ]]; then
33- echo >&2 " Error: Could not parse version from ./sv --version "
18+ echo >&2 " Error: Could not parse version"
3419 exit 1
3520fi
3621
4429
4530# --- Create and push the tag on HEAD (the merge commit) ---
4631echo " Tagging $TAG_NAME on $( git rev-parse --short HEAD) "
32+ git config user.name " github-actions[bot]"
33+ git config user.email " 41898282+github-actions[bot]@users.noreply.github.com"
4734git tag -a " $TAG_NAME " -m " Version $CURRENT_VERSION "
4835git push origin " $TAG_NAME "
0 commit comments