Merge pull request woocommerce/woocommerce-admin#2437 from woocommerce/fix/changelog-note-option
Changelog script: Use PR author note, if supplied
This commit is contained in:
commit
4edc9cdb9e
|
@ -23,4 +23,4 @@ be sure to detail parts affected in Release Notes --->
|
||||||
|
|
||||||
### Changelog Note:
|
### Changelog Note:
|
||||||
|
|
||||||
<!--- Please follow the WooCommerce core format using prefixes of Enhancement, Tweak, Dev, Fix --->
|
<!--- Optional: Enter a changelog note following the WooCommerce core format using prefixes of Enhancement:, Tweak:, Dev:, Fix:, Performance:. If no note is entered, one will be constructed from the title and labels. --->
|
||||||
|
|
|
@ -76,7 +76,22 @@ const writeEntry = async ( content_url ) => {
|
||||||
const labels = getLabels( data.labels );
|
const labels = getLabels( data.labels );
|
||||||
const labelTag = labels.length ? `(${ labels })` : '';
|
const labelTag = labels.length ? `(${ labels })` : '';
|
||||||
const authorTag = collaborator ? '' : `👏 @${ data.user.login }`;
|
const authorTag = collaborator ? '' : `👏 @${ data.user.login }`;
|
||||||
const entry = `- ${ type }: ${ data.title } #${ data.number } ${ labelTag } ${ authorTag }`;
|
let title;
|
||||||
|
if ( /### Changelog Note/.test( data.body ) ) {
|
||||||
|
const bodyParts = data.body.split( '### Changelog Note:' );
|
||||||
|
const note = bodyParts[ bodyParts.length - 1 ];
|
||||||
|
title = note
|
||||||
|
// Remove comment prompt
|
||||||
|
.replace( /<!---(.*)--->/gm, '' )
|
||||||
|
// Remove new lines and whitespace
|
||||||
|
.trim();
|
||||||
|
if ( ! title.length ) {
|
||||||
|
title = `${ type }: ${ data.title }`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
title = `${ type }: ${ data.title }`;
|
||||||
|
}
|
||||||
|
const entry = `- ${ title } #${ data.number } ${ labelTag } ${ authorTag }`;
|
||||||
console.log( entry );
|
console.log( entry );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue