Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Do not fail script when PR body is empty #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ const extractTrelloCardIds = (prBody, stopOnNonLink = true) => {

const cardIds = [];
const lines = prBody.split(browserEol);

if(!prBody || prBody==="") {
return cardIds;
}
//loop and gather up cardIds, skipping blank lines. stopOnNonLink == true will bust out when we're out of link-only territory.
for(const line of lines) {
const matches = linkRegex.exec(line);
Expand Down Expand Up @@ -168,4 +170,4 @@ const buildTrelloLinkComment = async (cardId) => {
//failure will stop PR from being mergeable if that setting enabled on the repo. there is not currently a neutral exit in actions v2.
core.setFailed(error.message);
}
})();
})();