Skip to content

Commit

Permalink
CI: check that the changelog is populated on each pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
almet committed Nov 10, 2024
1 parent 96aa56a commit 312f930
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/check_push.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Check branch conformity
on:
push:
pull_request:
types: [opened, synchronize, reopened]

jobs:
prevent-fixup-commits:
Expand All @@ -17,3 +18,16 @@ jobs:
git fetch origin
git status
git log --pretty=format:%s origin/main..HEAD | grep -ie '^fixup\|^wip' && exit 1 || true
check-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: ensure CHANGELOG.md is populated
run: |
CHANGELOG_MODIFIED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} | grep -c "CHANGELOG.md")
if [ $CHANGELOG_MODIFIED -eq 0 ]; then
echo "::error::No CHANGELOG modifications found in this pull request. Please update the CHANGELOG."
exit 1
fi
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ since 0.4.1, and this project adheres to [Semantic Versioning](https://semver.or

## [Unreleased](https://github.com/freedomofpress/dangerzone/compare/v0.8.0...HEAD)

### Development changes

- CI: Check that the changelog is populated on each pull request ([#995](https://github.com/freedomofpress/dangerzone/pull/995))


## [0.8.0](https://github.com/freedomofpress/dangerzone/compare/v0.8.0...0.7.1)

### Added
Expand Down

0 comments on commit 312f930

Please sign in to comment.