Skip to content

Commit

Permalink
Add a GitHub Actions workflow to automatically check for Changelog en…
Browse files Browse the repository at this point in the history
…tries on pull requests (#66)

* Add a GitHub Actions workflow to automatically check for Changelog entries on pull requests

* Add changelog entry
  • Loading branch information
ericof authored Mar 28, 2024
1 parent c2a934d commit 23a3080
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Changelog check
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all history
fetch-depth: '0'

- name: Install towncrier
run: pip install towncrier

- name: Check for presence of a Change Log fragment (only pull requests)
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 ${BASE_BRANCH}
towncrier check
env:
BASE_BRANCH: ${{ github.base_ref }}
if: github.event_name == 'pull_request'
1 change: 1 addition & 0 deletions news/65.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a GitHub Actions workflow to automatically check for Changelog entries on pull requests [@ericof]

0 comments on commit 23a3080

Please sign in to comment.