From 7c5f11779e0fe9a772af98c3688152722f0f7a57 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Tue, 5 May 2026 07:29:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20replace=20head=5Fcomm?= =?UTF-8?q?it.message=20expression=20with=20git=20log=20(shell=20injection?= =?UTF-8?q?)=20(#38)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gabriel Radureau Co-committed-by: Gabriel Radureau --- .gitea/workflows/ci-cd.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index feaf92e..64a2465 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -299,13 +299,11 @@ jobs: # Check for version bump on main branch if [ "${{ github.ref }}" = "refs/heads/main" ]; then echo "🔖 Checking for version bump..." - # ${{ 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 + # Always read from git log: ${{ github.event.head_commit.message }} expression + # is interpolated literally into the shell script, so any backtick, unbalanced + # quote, or special char in a commit body breaks the next line of the script + # (observed on PR #32-#35: 'syntax error: unexpected newline'). git log is safe. + COMMIT_MSG=$(git log -1 --pretty=%B) ./scripts/ci-version-bump.sh "$COMMIT_MSG" --no-push fi