Skip to content

Commit

Permalink
try a rule to check for a PR template
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
geekosaur committed Dec 2, 2024
1 parent 55ccc0a commit f97a7c0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pr-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Template

on:
pull_request:
push:
branches: ['master']

jobs:
templates:
defaults:
run:
shell: bash
runs-on: ubuntu-latest

steps:

- env:
BODY: ${{ github.event.pull_request.body }}
run: |
body="$(echo "$BODY" |
sed 's/~~[^~][^~]*~~//g' |
sed -n 's/^\* \[\(.\)\] Patches conform to the .*$/\1/p')"
# this ought to be a single space or 'x', but some people include both
# templates and either one might be checked
echo "$body" | grep -q '^x$'

0 comments on commit f97a7c0

Please sign in to comment.