From f027369da22940df3baefae8d0c02321a942c353 Mon Sep 17 00:00:00 2001 From: Yun Long Date: Tue, 9 Jun 2026 10:44:04 +0800 Subject: [PATCH] CI(body): Allow normal markdown body --- .github/workflows/pr-message.yml | 33 ++++++++++++-------------------- AGENTS.md | 2 +- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pr-message.yml b/.github/workflows/pr-message.yml index 89edd4de..6cac08a5 100644 --- a/.github/workflows/pr-message.yml +++ b/.github/workflows/pr-message.yml @@ -74,28 +74,19 @@ jobs: return; } - if (body.length > 0) { - const invalidLines = body - .split("\n") - .map((line, index) => ({ line, number: index + 1 })) - .filter(({ line }) => !/^- .+/.test(line)); + const conflictMarkerRe = + /^<{7}(?: .*)?$[\s\S]*^={7}$[\s\S]*^>{7}(?: .*)?$/m; - if (invalidLines.length > 0) { - core.setFailed( - [ - "Invalid PR body.", - "", - 'If PR body is present, every line must start with "- ".', - "Blank lines are not allowed.", - "", - "Invalid lines:", - ...invalidLines.map( - ({ number, line }) => ` line ${number}: ${line || ""}` - ), - ].join("\n") - ); - return; - } + if (conflictMarkerRe.test(body)) { + core.setFailed( + [ + "Invalid PR body.", + "", + "The body appears to contain unresolved merge conflict markers.", + "Please resolve the conflict markers before opening or updating the PR.", + ].join("\n") + ); + return; } core.info("PR title and body look good."); diff --git a/AGENTS.md b/AGENTS.md index 3ac99edf..d9c5b649 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,7 +54,7 @@ make release ## Git And PRs - Use Conventional Commits for commit messages and PR titles. -- Keep PR bodies compatible with `.github/workflows/pr-message.yml`: each line starts with `- `, no blank lines, no `Co-authored-by:` trailers. +- Keep PR bodies compatible with `.github/workflows/pr-message.yml`: use concise GitHub Markdown, and do not include `Co-authored-by:` trailers or unresolved conflict markers. - Keep PR bodies short and focused on summary, validation, impact, related issues, and notes. - Check PR CI before requesting review or merge.