diff --git a/.github/workflows/auto-fill-pr.yml b/.github/workflows/auto-fill-pr.yml index e8351bb..42e7b66 100644 --- a/.github/workflows/auto-fill-pr.yml +++ b/.github/workflows/auto-fill-pr.yml @@ -234,9 +234,17 @@ jobs: const sectionRegex = new RegExp(`## ${sectionHeader}\\s*([\\s\\S]*?)(?=\\n## |$)`, 'i'); const match = body.match(sectionRegex); if (!match) return true; - const content = match[1].trim(); - // Empty if only whitespace, empty, or just an HTML comment - return !content || /^$/.test(content); + // Strip noise that doesn't count as user content: + // - HTML comments (template placeholders) + // - Reference-style link definitions added by Jira/GitHub integrations (e.g. [IM-123]: https://...) + // - Horizontal rules and our own footer markers (from previous workflow runs) + const content = match[1] + .replace(//g, '') + .replace(/^\[.+?\]:\s*\S.*$/gm, '') + .replace(/^[-*]{3,}$/gm, '') + .replace(/^_.*Auto-(generated|filled).*_$/gm, '') + .trim(); + return !content; }; // Helper to check if any checkbox is checked in Type of Change @@ -334,7 +342,7 @@ jobs: // Add footer if we changed anything const madeChanges = fillDescription || (fillTicket && ticketSection) || fillType || (fillTesting && testing); if (madeChanges && !newBody.includes('Auto-generated by Claude') && !newBody.includes('Auto-filled')) { - const footer = claudeSuccess ? '\n\n---\n_✨ Auto-generated by Claude_' : '\n\n---\n_📝 Auto-filled_'; + const footer = claudeSuccess ? '\n\n***\n_✨ Auto-generated by Claude_' : '\n\n***\n_📝 Auto-filled_'; newBody = newBody.trim() + footer; }