mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 20:50:44 +00:00
39 lines
1.4 KiB
YAML
39 lines
1.4 KiB
YAML
name: PR template
|
|
|
|
# Fails when a pull request description does not follow
|
|
# .github/PULL_REQUEST_TEMPLATE.md: every section present and filled in, a
|
|
# linked issue ("Closes #N" or "No linked issue: <reason>"), and the
|
|
# claimed-first and DCO checkboxes ticked. Runs again whenever the description
|
|
# is edited; comments never start it. Runs on the base branch: pull request
|
|
# code is never checked out or executed, and the description is read as data.
|
|
#
|
|
# To make it blocking, mark the "PR template / description" check as required
|
|
# in the branch protection rule for main.
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, edited, reopened, synchronize]
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
description:
|
|
runs-on: ubuntu-24.04-arm
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Check the description against the template
|
|
run: |
|
|
set -u
|
|
status=0
|
|
python3 scripts/pr_template_check.py --event "$GITHUB_EVENT_PATH" > "$RUNNER_TEMP/result.txt" || status=$?
|
|
cat "$RUNNER_TEMP/result.txt"
|
|
{ echo '## PR template'; cat "$RUNNER_TEMP/result.txt"; } >> "$GITHUB_STEP_SUMMARY"
|
|
if [ "$status" -ne 0 ]; then
|
|
echo "::error title=PR description does not follow the template::$(tail -n +2 "$RUNNER_TEMP/result.txt" | head -n -1 | tr '\n' ' ')"
|
|
fi
|
|
exit "$status"
|