-
Notifications
You must be signed in to change notification settings - Fork 132
27 lines (24 loc) · 821 Bytes
/
validate-pr.yml
File metadata and controls
27 lines (24 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: PR Validation
on:
pull_request:
types: [opened, edited, reopened, synchronize]
jobs:
pr-check:
runs-on: ubuntu-latest
steps:
- name: Verify PR Checklist
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prBody = context.payload.pull_request.body || '';
const errors = [];
if (!prBody.includes('[x] I have read CONTRIBUTING.md')) {
errors.push('Please check the box confirming you have read CONTRIBUTING.md.');
}
if (!prBody.includes('Signed-off-by:')) {
errors.push('Missing "Signed-off-by:" line in PR.');
}
if (errors.length > 0) {
core.setFailed(errors.join('\n'));
}