Skip to content

Fix changelog checks #2117

Fix changelog checks

Fix changelog checks #2117

Workflow file for this run

name: Changelog
on:
pull_request:
# should also be re-run when changing labels
types: [opened, reopened, labeled, unlabeled, synchronize]
env:
FRAGMENT_NAME_PREFIX: "docs/changes/${{ github.event.number }}"
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for at least one changelog fragment
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-needed') }}
run: |
CHANGE_TYPES=("feature" "bugfix" "api" "datamodel" "optimization" "maintenance")
FRAGMENT_FOUND=false
for CHANGE_TYPE in "${CHANGE_TYPES[@]}"; do
FILE="${{ env.FRAGMENT_NAME_PREFIX }}.${CHANGE_TYPE}.rst"
if [ -f "$FILE" ]; then
FRAGMENT_FOUND=true
break
fi
done
if [ "$FRAGMENT_FOUND" = false ]; then
echo "No changelog fragment found. Please add a changelog fragment."
exit 1
fi