Fix: workflows using comment-aggregator are failing on trunk (https://github.com/woocommerce/woocommerce-blocks/pull/8010)

This commit is contained in:
Tung Du 2022-12-21 23:30:25 +07:00 committed by GitHub
parent a6c30f3c70
commit da4221a9a7
4 changed files with 11 additions and 6 deletions

View File

@ -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.
- **`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.
## More examples

View File

@ -9,7 +9,7 @@ inputs:
required: true
content:
description: 'Comment content'
required: true
default: ''
order:
description: 'Order of the comment'
required: false

View File

@ -16,12 +16,17 @@ const runner = async () => {
const payload = context.payload;
const repo = payload.repository.name;
const owner = payload.repository.owner.login;
// Only run this action on pull requests.
if ( ! payload.pull_request?.number ) {
return;
}
const sectionId = getInput( 'section-id', {
required: true,
} );
const content = getInput( 'content', {
required: true,
} );
const content = getInput( 'content' );
const order = getInput( 'order' );
if ( ! sectionId || ! content ) {

View File

@ -1,7 +1,7 @@
const identifier = `<!-- comments-aggregator -->`;
const separator = '<!-- separator -->';
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 }`;
function getSectionId( section ) {