From 3d9a8a341775f1dedea70ab59d1a00043f7ea467 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 16 Dec 2025 16:40:14 -0600 Subject: [PATCH] Update version_branch.yml --- .github/workflows/version_branch.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version_branch.yml b/.github/workflows/version_branch.yml index 7721da6..54dcf68 100644 --- a/.github/workflows/version_branch.yml +++ b/.github/workflows/version_branch.yml @@ -1,5 +1,4 @@ -name: Create version branch and bump versions (src and docs only) - +name: Create version branch and bump versions on: workflow_dispatch: inputs: @@ -255,12 +254,25 @@ jobs: set -Eeuo pipefail trap 'echo "[FATAL] Commit failed at line $LINENO" >&2; echo "[FATAL] Last command: $BASH_COMMAND" >&2' ERR + git rev-parse --is-inside-work-tree >/dev/null 2>&1 || { echo "[ERROR] Not inside a git work tree" >&2; exit 2; } + if [[ -z "$(git status --porcelain=v1)" ]]; then echo "[INFO] No changes detected. Skipping commit and push." exit 0 fi - git add src docs + ADD_PATHS=() + [[ -d "src" ]] && ADD_PATHS+=("src") + [[ -d "docs" ]] && ADD_PATHS+=("docs") + + if [[ "${#ADD_PATHS[@]}" -eq 0 ]]; then + echo "[ERROR] Neither ./src nor ./docs exists at commit time" >&2 + exit 2 + fi + + echo "[INFO] Staging paths: ${ADD_PATHS[*]}" + git add -- "${ADD_PATHS[@]}" + git commit -m "chore(release): bump version to ${NEW_VERSION}" - name: Push branch