From 099f9d27ad5ddef826dfd7334c526b045c347e31 Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Thu, 5 Feb 2026 18:56:51 -0800 Subject: [PATCH] fix(ci): make workflow robust to special characters in commit messages (#152) The unified-pipeline workflow was failing when commit messages contained special characters (like quotes in 'won\'t be transcribed'). The shell pattern matching was fragile and would break on various characters. Fix: - Replace fragile glob pattern matching with grep case-insensitive search - Look for common website-related commit prefixes: feat(website) docs(website) chore(website) fix(website) refactor(website) - This is more robust and handles special characters gracefully - Fix YAML formatting issue with blank line This makes the CI workflow more reliable and less fragile. --- .github/workflows/unified-pipeline.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unified-pipeline.yml b/.github/workflows/unified-pipeline.yml index 6787332..f32028e 100644 --- a/.github/workflows/unified-pipeline.yml +++ b/.github/workflows/unified-pipeline.yml @@ -48,10 +48,13 @@ jobs: run: | # Deploy if web files changed OR python files changed (for version updates) COMMIT_MESSAGE="${{ github.event.head_commit.message }}" + + # Escape the commit message properly for shell comparison + # Use case-insensitive matching with grep instead of glob patterns if [[ "${{ steps.filter.outputs.web }}" == "true" ]] || \ [[ "${{ steps.filter.outputs.python }}" == "true" ]] || \ [[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \ - [[ "$COMMIT_MESSAGE" == *"[web]"* ]]; then + echo "$COMMIT_MESSAGE" | grep -iE "(feat\(website\)|docs\(website\)|chore\(website\)|fix\(website\)|refactor\(website\))"; then echo "deploy=true" >> $GITHUB_OUTPUT else echo "deploy=false" >> $GITHUB_OUTPUT