2021-08-15 10:15:05 +02:00
|
|
|
name: Check
|
|
|
|
|
2021-04-07 10:32:06 +02:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [labeled, unlabeled, opened, reopened, synchronize]
|
2021-08-15 10:15:05 +02:00
|
|
|
|
2021-04-07 10:32:06 +02:00
|
|
|
jobs:
|
2021-08-15 10:15:05 +02:00
|
|
|
check-news-entry:
|
|
|
|
name: news entry
|
2021-04-07 10:32:06 +02:00
|
|
|
runs-on: ubuntu-20.04
|
2021-08-15 10:15:05 +02:00
|
|
|
|
2021-04-07 10:32:06 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2021-08-15 10:15:05 +02:00
|
|
|
# `towncrier check` runs `git diff --name-only origin/main...`, which
|
|
|
|
# needs a non-shallow clone.
|
2021-04-07 10:32:06 +02:00
|
|
|
fetch-depth: 0
|
2021-08-15 11:26:50 +02:00
|
|
|
|
|
|
|
- name: Check news entry
|
2022-06-10 12:33:28 +02:00
|
|
|
if: "!contains(github.event.pull_request.labels.*.name, 'skip news')"
|
2021-08-15 11:26:50 +02:00
|
|
|
run: |
|
|
|
|
if ! pipx run towncrier check --compare-with origin/${{ github.base_ref }}; then
|
2021-08-15 12:57:58 +02:00
|
|
|
echo "Please see https://pip.pypa.io/dev/news-entry-failure for guidance."
|
2021-08-15 11:26:50 +02:00
|
|
|
false
|
|
|
|
fi
|