Compare commits

...

2 Commits

Author SHA1 Message Date
dbd94e7b37 Merge pull request 'Make Claude Code footer stripping more robust' (#25) from probablycorey/fix-claude-footer-strip into main
Some checks failed
CI / test (push) Has been cancelled
Reviewed-on: #25
2026-03-11 21:06:51 +00:00
c22c5c423c Make Claude Code footer stripping more robust
Some checks failed
CI / test (pull_request) Has been cancelled
Updated the regex to match the robot emoji followed by "Claude Code" on the last line, regardless of formatting. Also pulled the regex into a named variable with a comment to clarify intent. This catches variations like "Generated with Claude Code" without square brackets.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-11 13:18:24 -07:00

View File

@ -112,8 +112,10 @@ class PRHandler {
}
static formatPrBody(pullRequest: Gitea.PullRequest, repositoryFullName: string): string {
// Strip the "🤖 Generated with Claude Code" footer that gets appended to PR bodies
const claudeFooter = /\n*🤖.*Claude Code[^\n]*$/
const body = (pullRequest.body || "_empty_")
.replace(/\n*🤖 Generated with \[Claude Code\].*$/s, "")
.replace(claudeFooter, "")
.trim() || "_empty_"
let message = `
> ### [${pullRequest.title}](<${pullRequest.html_url}>)