From 68014277124065890a857942a0f163aa39bf18e1 Mon Sep 17 00:00:00 2001 From: Adam Rozman Date: Mon, 30 Dec 2024 13:51:42 +0200 Subject: [PATCH] fix incorrect PR title handling This commit: - Changes the PR title in the PR verifier script to be a constant string in the BASH context. Signed-off-by: Adam Rozman --- .github/workflows/pr-verifier.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-verifier.yaml b/.github/workflows/pr-verifier.yaml index 5faa8a9d..0cda4329 100644 --- a/.github/workflows/pr-verifier.yaml +++ b/.github/workflows/pr-verifier.yaml @@ -2,7 +2,8 @@ name: Check PR Title permissions: {} on: - workflow_call: + pull_request: + types: [opened, edited, synchronize, reopened] jobs: check-title: @@ -13,12 +14,12 @@ jobs: - name: Validate PR Title run: | - WIP_REGEX="^\W?WIP\W" - TAG_REGEX="^\[[[:alnum:]\._-]*\]" - PR_TITLE="${{ github.event.pull_request.title }}" + WIP_REGEX='^\W?WIP\W' + TAG_REGEX='^\[[[:alnum:]\._-]*\]' + PR_TITLE='${{ github.event.pull_request.title }}' # Trim WIP and tags from title - trimmed_title=$(echo "$PR_TITLE" | sed -E "s/$WIP_REGEX//" | sed -E "s/$TAG_REGEX//" | xargs) + trimmed_title=$(echo "${PR_TITLE}" | sed -E "s/$WIP_REGEX//" | sed -E "s/$TAG_REGEX//" | xargs) # Normalize common emojis in text form to actual emojis trimmed_title=$(echo "$trimmed_title" | sed -E "s/:warning:/⚠/g")