| 1 |
name: Pull Request requires towncrier file |
| 2 |
|
| 3 |
on: |
| 4 |
- pull_request |
| 5 |
|
| 6 |
jobs: |
| 7 |
pr_require_towncrier_file: |
| 8 |
runs-on: ubuntu-latest |
| 9 |
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.user.login != 'pre-commit-ci[bot]' |
| 10 |
steps: |
| 11 |
- uses: actions/checkout@v7 |
| 12 |
- name: Ensure towncrier file exists |
| 13 |
env: |
| 14 |
PR_NUMBER: ${{ github.event.number }} |
| 15 |
run: | |
| 16 |
if [ ! -f "changes/${PR_NUMBER}.feature.rst" ] && [ ! -f "changes/${PR_NUMBER}.bugfix.rst" ] && [ ! -f "changes/${PR_NUMBER}.doc.rst" ] && [ ! -f "changes/${PR_NUMBER}.removal.rst" ] && [ ! -f "changes/${PR_NUMBER}.misc.rst" ]; then |
| 17 |
echo "Towncrier file for #${PR_NUMBER} not found. Please add a changes file to the `changes/` directory. See README.rst for more information." |
| 18 |
exit 1 |
| 19 |
fi |