-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: check that the changelog is populated on each pull request
- Loading branch information
Showing
3 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Check branch conformity | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
prevent-fixup-commits: | ||
runs-on: ubuntu-latest | ||
env: | ||
target: debian-bookworm | ||
distro: debian | ||
version: bookworm | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: prevent fixup commits | ||
run: | | ||
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 | ||
with: | ||
fetch-depth: 0 | ||
- name: ensure CHANGELOG.md is populated | ||
env: | ||
BASE_REF: ${{ github.event.pull_request.base.ref }} | ||
NO_CHANGELOG_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no changelog') }} | ||
shell: bash | ||
run: | | ||
if [ "${NO_CHANGELOG_LABEL}" = "true" ]; then | ||
exit 0 | ||
else | ||
if git diff --exit-code "origin/${BASE_REF}" -- CHANGELOG.md; then | ||
echo "::error::No CHANGELOG.md modifications found in this pull request. You can override this check by adding the 'no changelog' label to the pull request." | ||
exit 1 | ||
fi | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters