Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010)
This commit is contained in:
parent
a6c30f3c70
commit
da4221a9a7
|
@ -28,7 +28,7 @@ This action is meant to be used as the poster/commenter. Instead of having exist
|
||||||
|
|
||||||
- **`repo-token`** (required): This is the GitHub token. This is required to manipulate PR comments.
|
- **`repo-token`** (required): This is the GitHub token. This is required to manipulate PR comments.
|
||||||
- **`section-id`** (required): The unique ID that helps this action to update the correct part of the aggregated comment.
|
- **`section-id`** (required): The unique ID that helps this action to update the correct part of the aggregated comment.
|
||||||
- **`content`** (required): The comment content.
|
- **`content`** (option): The comment content. Default to empty. If nothing was provided, this action will stop gracefully.
|
||||||
- **`order`** (optional): The order of the comment part inside the aggregated comment. Default to 10.
|
- **`order`** (optional): The order of the comment part inside the aggregated comment. Default to 10.
|
||||||
|
|
||||||
## More examples
|
## More examples
|
||||||
|
|
|
@ -9,7 +9,7 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
description: 'Comment content'
|
description: 'Comment content'
|
||||||
required: true
|
default: ''
|
||||||
order:
|
order:
|
||||||
description: 'Order of the comment'
|
description: 'Order of the comment'
|
||||||
required: false
|
required: false
|
||||||
|
|
|
@ -16,12 +16,17 @@ const runner = async () => {
|
||||||
const payload = context.payload;
|
const payload = context.payload;
|
||||||
const repo = payload.repository.name;
|
const repo = payload.repository.name;
|
||||||
const owner = payload.repository.owner.login;
|
const owner = payload.repository.owner.login;
|
||||||
|
|
||||||
|
// Only run this action on pull requests.
|
||||||
|
if ( ! payload.pull_request?.number ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const sectionId = getInput( 'section-id', {
|
const sectionId = getInput( 'section-id', {
|
||||||
required: true,
|
required: true,
|
||||||
} );
|
} );
|
||||||
const content = getInput( 'content', {
|
|
||||||
required: true,
|
const content = getInput( 'content' );
|
||||||
} );
|
|
||||||
const order = getInput( 'order' );
|
const order = getInput( 'order' );
|
||||||
|
|
||||||
if ( ! sectionId || ! content ) {
|
if ( ! sectionId || ! content ) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const identifier = `<!-- comments-aggregator -->`;
|
const identifier = `<!-- comments-aggregator -->`;
|
||||||
const separator = '<!-- separator -->';
|
const separator = '<!-- separator -->';
|
||||||
const footerText =
|
const footerText =
|
||||||
'[comments-aggregator](https://github.com/woocommerce/woocommerce-blocks/tree/trunk/.github/comments-aggregator).';
|
'[comments-aggregator](https://github.com/woocommerce/woocommerce-blocks/tree/trunk/.github/comments-aggregator)';
|
||||||
const footer = `\n> <sub>${ footerText }</sub>\n${ identifier }`;
|
const footer = `\n> <sub>${ footerText }</sub>\n${ identifier }`;
|
||||||
|
|
||||||
function getSectionId( section ) {
|
function getSectionId( section ) {
|
||||||
|
|
Loading…
Reference in New Issue