From 321b21b995cf5e4f4272fadad1b88d0d6bdaab30 Mon Sep 17 00:00:00 2001 From: Vincent Germain Date: Mon, 7 Aug 2023 09:47:38 +0200 Subject: [PATCH] fix(ci): escape single quote from pr title, and forbid generic one --- .github/workflows/check-pull-request.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-pull-request.yml b/.github/workflows/check-pull-request.yml index 0f749e2e4..d5dcde0c4 100644 --- a/.github/workflows/check-pull-request.yml +++ b/.github/workflows/check-pull-request.yml @@ -17,4 +17,13 @@ jobs: check-latest: true cache: "pnpm" - run: pnpm install - - run: echo '${{ github.event.pull_request.title }}' | pnpm commitlint + - name: Check title + run: | + title="${{ github.event.pull_request.title }}" + title_escaped=${title//\'/\'} + if [ "$title" == "feat: update generated APIs" ]; then + echo "Invalid title." + exit 1 + else + echo "$title_escaped" | pnpm commitlint + fi