Commit 7f4081d7032 for woocommerce
commit 7f4081d7032ee46cafad0a19fce5d4f3f9852756
Author: Ahmed <ahmed.el.azzabi@automattic.com>
Date: Wed Jul 15 15:39:27 2026 +0300
Add single-line changelog validation to CI (#66647)
* Add CI validation to reject multi-line changelog entry messages
Multi-line changelog messages break the line-based sorting and rendering
performed by the "Release: Compile changelog" workflow. Add a validation
step to the existing changelog validation job that scans changelog entry
files and fails when a message body spans more than one line.
Closes #60678
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013mYJFSbssivXbaZpHWTqqG
* Detect Significance header anywhere in changelog entry, not only line 1
Make the single-line validation robust to header ordering: identify a
changelog entry file by a `Significance:` header appearing anywhere in the
header block rather than assuming it is the first line. This avoids skipping
validation for entries whose headers are reordered, while still excluding
source files that happen to live in a directory named `changelog`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013mYJFSbssivXbaZpHWTqqG
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 666a675960b..370a4c8bc47 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -634,6 +634,24 @@ jobs:
pnpm --parallel --workspace-concurrency=10 --stream $filter changelog validate
+ - name: 'Validate - single-line messages'
+ run: |
+ # Changelog entry messages must be a single line. Multi-line messages break the
+ # line-based sorting and rendering done by the "Release: Compile changelog" workflow.
+ fail=0
+ while IFS= read -r file; do
+ if ! awk '
+ !body && /^Significance:/ { sig=1 }
+ !body && /^[[:space:]]*$/ { body=1; next }
+ body { if (NF) c++ }
+ END { exit (sig && c>1) }
+ ' "$file"; then
+ echo "::error file=${file}::Changelog message must be a single line so it can be sorted and rendered correctly during release. Move any extra detail into the 'Comment:' header."
+ fail=1
+ fi
+ done < <(git ls-files -- '*/changelog/*' ':!:*/changelog/*.md' ':!:*/changelog/*.txt' ':!:*/changelog/.*')
+ exit $fail
+
validate-markdown:
name: 'Validate markdown'
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'trunk' && needs.identify-jobs-to-run.outputs.needs-markdown-validation == 'true' }}