From b1fd05e9e967f900c78b697b0f7b8e9ca37c5ba2 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Mon, 2 Dec 2024 13:23:07 -0500 Subject: [PATCH] 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). --- .github/workflows/pr-template.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pr-template.yml diff --git a/.github/workflows/pr-template.yml b/.github/workflows/pr-template.yml new file mode 100644 index 00000000000..c6bc11ff17a --- /dev/null +++ b/.github/workflows/pr-template.yml @@ -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$'