Fix changelog check to accept Prior versions entries

This commit is contained in:
jesusph04
2026-08-03 12:47:54 +02:00
parent 6852ecae39
commit 758ccaf309
+3 -2
View File
@@ -32,10 +32,11 @@ jobs:
FORMAT="✅"
ENTRY_REGEX='^- .+ \(\[#[0-9]+\]\(https://github\.com/[^)]+/(issues|pull)/[0-9]+\)\)$'
INVALID=$(echo "$ADDED" | grep -E '^- ' | grep -vx -- '- None' | grep -vE "$ENTRY_REGEX" || true)
PRIOR_VERSION_REGEX='^- \[v[0-9]+\.[0-9]+\.[0-9]+\]\(https://github\.com/[^)]+/blob/v[0-9]+\.[0-9]+\.[0-9]+/CHANGELOG\.md\)$'
INVALID=$(echo "$ADDED" | grep -E '^- ' | grep -vx -- '- None' | grep -vE "$ENTRY_REGEX" | grep -vE "$PRIOR_VERSION_REGEX" || true)
if [ -n "$INVALID" ]; then
FORMAT="❌"
echo "::error::Invalid CHANGELOG.md entries. Expected format: '- Description ([#123](https://github.com/<org>/<repo>/issues/123))'. Offending lines:"
echo "::error::Invalid CHANGELOG.md entries. Expected format: '- Description ([#123](https://github.com/<org>/<repo>/issues/123))' or, for the Prior versions section, '- [vX.X.X](https://github.com/<org>/<repo>/blob/vX.X.X/CHANGELOG.md)'. Offending lines:"
echo "$INVALID"
fi
fi