Add GitHub action to check for a towncrier file

This commit is contained in:
Benoit Marty 2022-07-06 11:51:30 +02:00
parent 7616912411
commit 0776d394bc
1 changed files with 23 additions and 0 deletions

View File

@ -203,3 +203,26 @@ jobs:
name: detekt-report name: detekt-report
path: | path: |
*/build/reports/detekt/detekt.html */build/reports/detekt/detekt.html
towncrier:
name: Check that there is at least one file for the changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install towncrier
run: |
python3 -m pip install towncrier
- name: Run towncrier
run: |
# Fetch the pull request' base branch so towncrier will be able to
# compare the current branch with the base branch.
# Source: https://github.com/actions/checkout/#fetch-all-branches.
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
towncrier check --compare-with origin/${BASE_BRANCH}
env:
BASE_BRANCH: ${{ github.base_ref }}
if: github.event_name == 'pull_request'