diff --git a/.github/workflows/check-newsfragment.yml b/.github/workflows/check-newsfragment.yml new file mode 100644 index 000000000..0aa78fcd3 --- /dev/null +++ b/.github/workflows/check-newsfragment.yml @@ -0,0 +1,23 @@ +name: Check newsfragment + +on: + pull_request: + types: [labeled, unlabeled, opened, synchronize] + branches: + - main + +jobs: + check-newsfragment: + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip newsfragment') }} + runs-on: 'ubuntu-latest' + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check newsfragments + run: | + if git diff --name-only origin/main | grep -v '/_tests/' | grep 'src/trio/'; then + git diff --name-only origin/main | grep 'newsfragments/' || exit 1 + fi