From b16f78294dcaa153f78aa796ac127448409988ee Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Tue, 5 May 2026 09:33:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20remove=20${{=20...=20?= =?UTF-8?q?}}=20expression=20from=20comment=20that=20still=20gets=20interp?= =?UTF-8?q?olated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to PR #38. That PR fixed the SHELL line (replaced ${{ github.event.head_commit.message }} with git log) but kept a comment mentioning the expression literally. Comments are not exempt: the runner template engine interpolates ${{ ... }} BEFORE bash sees the script, so the multi-line commit body still ended up injected mid-comment and broke bash parsing on the next line. Symptom (still fired on PRs #40-#45 even after PR #38): /var/run/act/workflow/12.sh: line 32: syntax error: unexpected newline ❌ Failure - Update badges and version Fix: rewrite the comment without the literal expression. The other 3 references to head_commit.message in this file are inside job-level if: contains(...) checks which are evaluated server-side as booleans, not interpolated into shell — those are safe and unchanged. Lesson for the verifier checklist: when fixing template-injection bugs, search the WHOLE FILE for the expression including comments, not just active code lines. --- .gitea/workflows/ci-cd.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 64a2465..df418d3 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -299,10 +299,11 @@ jobs: # Check for version bump on main branch if [ "${{ github.ref }}" = "refs/heads/main" ]; then echo "🔖 Checking for version bump..." - # 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. + # Read commit message from git, NOT from the workflow event payload. + # The event-payload expression is interpolated literally into the + # rendered script (even inside comments — see PR #38 + #46), so any + # backtick / unbalanced quote / multi-line body breaks bash parsing. + # git log is interpolation-free and safe. COMMIT_MSG=$(git log -1 --pretty=%B) ./scripts/ci-version-bump.sh "$COMMIT_MSG" --no-push fi