From 17130082c6d80377eea4726467219157d1320f27 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Sun, 3 May 2026 16:42:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20version-bump=20fallba?= =?UTF-8?q?ck=20for=20workflow=5Fdispatch=20trigger=20(#31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit workflow_dispatch event has no head_commit, so version-bump script was getting empty input and failing the whole workflow. Fall back to git log -1 when event context is empty. Co-authored-by: Gabriel Radureau Co-committed-by: Gabriel Radureau --- .gitea/workflows/ci-cd.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index b5af3d7..16420ea 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -297,7 +297,14 @@ jobs: # Check for version bump on main branch if [ "${{ github.ref }}" = "refs/heads/main" ]; then echo "🔖 Checking for version bump..." - ./scripts/ci-version-bump.sh "${{ github.event.head_commit.message }}" --no-push + # ${{ github.event.head_commit.message }} is empty on workflow_dispatch (manual trigger). + # Fall back to the latest commit message from `git log` so the script always has input. + COMMIT_MSG="${{ github.event.head_commit.message }}" + if [ -z "$COMMIT_MSG" ]; then + COMMIT_MSG=$(git log -1 --pretty=%B) + echo " (using git log -1 because head_commit.message is empty - probably workflow_dispatch)" + fi + ./scripts/ci-version-bump.sh "$COMMIT_MSG" --no-push fi # Single push for all commits (this is the ONLY push in the entire workflow)