Skip to content

Commit b1fd05e

Browse files
committed
try a rule to check for a PR template
For now it checks for the first item, which is the same in both and should always be required (many of the others are arguable in various circumstances).
1 parent 55ccc0a commit b1fd05e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/pr-template.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PR Template
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ['master']
7+
8+
jobs:
9+
templates:
10+
defaults:
11+
run:
12+
shell: bash
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
17+
- env:
18+
BODY: ${{ github.event.pull_request.body }}
19+
run: |
20+
body="$(echo "$BODY" |
21+
sed 's/~~[^~][^~]*~~//g' |
22+
sed -n 's/^\[\(.\)\] Patches conform to the .*$/\1/p')"
23+
# this ought to be a single space or 'x', but some people include both
24+
# templates and either one might be checked
25+
echo "$body" | grep -q '^x$'

0 commit comments

Comments
 (0)