mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
.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.
This commit is contained in:
parent
d0602ba45a
commit
a9ac275588
1 changed files with 23 additions and 0 deletions
23
.github/workflows/validate_pr.yml
vendored
Normal file
23
.github/workflows/validate_pr.yml
vendored
Normal file
|
|
@ -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');
|
||||
Loading…
Reference in a new issue