Skip to content

Commit

Permalink
More robust check if body has already been updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rbergheim authored Apr 27, 2023
1 parent c02812e commit 75aa3a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function run() {
bodyUppercaseHeadMatch:
core.getInput("body-uppercase-head-match").toLowerCase() === "true",
failOnError:
core.getInput("fail-on-error").toLowerCase() === "true",
!(core.getInput("fail-on-error").toLowerCase() === "false"),
};

const baseBranchRegex = inputs.baseBranchRegex.trim();
Expand Down Expand Up @@ -149,9 +149,9 @@ async function run() {

const updateBody =
{
prefix: !body.toLowerCase().startsWith(processedBodyText.toLowerCase()),
suffix: !body.toLowerCase().endsWith(processedBodyText.toLowerCase()),
replace: body.toLowerCase() !== processedBodyText.toLowerCase(),
prefix: !body.trim().toLowerCase().startsWith(processedBodyText.trim().toLowerCase()),
suffix: !body.trim().toLowerCase().endsWith(processedBodyText.trim().toLowerCase()),
replace: body.trim().toLowerCase() !== processedBodyText.trim().toLowerCase(),
}[inputs.bodyUpdateAction] || false;

core.setOutput("bodyUpdated", updateBody.toString());
Expand Down

0 comments on commit 75aa3a3

Please sign in to comment.