diff --git a/.github/workflows/pr-verifier.yaml b/.github/workflows/pr-verifier.yaml index 5faa8a9d..c9cc823d 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: @@ -12,13 +13,14 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Validate PR Title + env: + PR_TITLE: ${{ github.event.pull_request.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:]\._-]*\]' # 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")