From a9ac2755886299eb200e9725c6412f7bfca83246 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Mon, 25 Aug 2025 11:02:33 +0200 Subject: [PATCH] .github/workflows: naive PR format checker (#32480) Full disclosure: this has been generated by AI. The goal is to have a quick check that the PR format is correct, before we merge it. This is to avoid the periodical case when someone forgets to add a milestone or check the title matches our preferred format. --- .github/workflows/validate_pr.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/validate_pr.yml diff --git a/.github/workflows/validate_pr.yml b/.github/workflows/validate_pr.yml new file mode 100644 index 0000000000..8c9ae1688f --- /dev/null +++ b/.github/workflows/validate_pr.yml @@ -0,0 +1,23 @@ +name: PR Format Validation + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + validate-pr: + runs-on: ubuntu-latest + steps: + - name: Check PR Title Format + uses: actions/github-script@v7 + with: + script: | + const prTitle = context.payload.pull_request.title; + const titleRegex = /^(\.?[\w\s,{}/]+): .+/; + + if (!titleRegex.test(prTitle)) { + core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`); + return; + } + + console.log('✅ PR title format is valid');