From bdb036eed35ae603a5547ed9e963d726134f3d08 Mon Sep 17 00:00:00 2001 From: Jack Lynch Date: Thu, 5 Mar 2026 15:59:14 +0000 Subject: [PATCH] FDN-4581 Centralize github workflow definitions --- .github/workflows/pr-validator.yml | 32 ++---------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pr-validator.yml b/.github/workflows/pr-validator.yml index f759c23..6879a59 100644 --- a/.github/workflows/pr-validator.yml +++ b/.github/workflows/pr-validator.yml @@ -2,35 +2,7 @@ name: "PR Title and Description Check" on: pull_request: types: [opened, edited, synchronize] - jobs: - check-title-and-description: - runs-on: ubuntu-latest - steps: - - name: Check PR title and description - uses: actions/github-script@v4 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const payload = context.payload; - const prTitle = payload.pull_request.title; - - // The pattern for JIRA ticket format - // Must be at the beginning of the PR title - // Prefix must be at least 3 uppercase letters - // Excludes tickets with only zeros after the prefix (e.g., XXX-000, XXX-0000) - // Number must be 3 to 6 digits - const jiraPattern = /^[A-Z]{3,}-(?!0+\b)\d{3,6}\b/; - - // Check PR title - const hasJiraTitle = jiraPattern.test(prTitle); - console.log(`PR title: ${hasJiraTitle ? 'Valid' : 'Invalid'}`); - - if (hasJiraTitle) { - console.log('PR title format is correct.'); - } else { - const errorMessage = 'The PR title must start with a valid JIRA ticket with 3-6 digits (e.g., ABC-123, DATAPLATFORM-12345). The ticket must be at the start, use at least 3 uppercase letters, and the number must not be all zeros.'; - console.log(errorMessage); + validate: + uses: flowcommerce/code-steward/.github/workflows/pr-validator.yml@main - core.setFailed(errorMessage); - }