@@ -452,6 +452,28 @@ function resolveAgentType({ inputs = {}, env = {}, pr = {} } = {}) {
452452 return '' ;
453453}
454454
455+ function prLabelNames ( pr = { } ) {
456+ return new Set (
457+ ( Array . isArray ( pr . labels ) ? pr . labels : [ ] )
458+ . map ( ( label ) => normalise ( typeof label === 'string' ? label : label ?. name ) )
459+ . filter ( Boolean ) ,
460+ ) ;
461+ }
462+
463+ function isReleasePleasePr ( pr = { } ) {
464+ const labels = prLabelNames ( pr ) ;
465+ const title = normalise ( pr . title ) ;
466+ const body = normalise ( pr . body ) ;
467+ const headRef = normalise ( pr . head ?. ref || pr . headRefName ) ;
468+
469+ return (
470+ headRef . startsWith ( 'release-please--branches--' ) ||
471+ labels . has ( 'autorelease: pending' ) ||
472+ / ^ c h o r e \( [ ^ ) ] * \) : \s * r e l e a s e \b / i. test ( title ) ||
473+ / \b r e l e a s e - p l e a s e \b / i. test ( body )
474+ ) ;
475+ }
476+
455477/**
456478 * Merge checkbox states from existingStates into newContent.
457479 * Only unchecked items `- [ ]` in newContent get their state restored.
@@ -1380,6 +1402,11 @@ async function run({github: rawGithub, context, core, inputs}) {
13801402 return ;
13811403 }
13821404
1405+ if ( isReleasePleasePr ( pr ) ) {
1406+ core . info ( `PR #${ pr . number } is a release-please PR; skipping issue-sourced PR body sync.` ) ;
1407+ return ;
1408+ }
1409+
13831410 const sourceContext = resolvePrSourceContext ( pr ) ;
13841411 const issueNumber = sourceContext . issueNumber ;
13851412 if ( sourceContext . noAutomation ) {
@@ -1702,6 +1729,8 @@ module.exports = {
17021729 buildPreamble,
17031730 buildSourceContextRepairCommentBody,
17041731 buildSourceContextResolvedCommentBody,
1732+ prLabelNames,
1733+ isReleasePleasePr,
17051734 resolveExplicitNonIssueWorkflowSourceContext,
17061735 extractExplicitIssueSyncNumbers,
17071736 hasExplicitIssueSyncReference,
0 commit comments