Skip to content

Commit

Permalink
Converting value to boolean 🐛 #140
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Sep 9, 2024
1 parent 3eee11a commit b443b99
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function run() {
const bodyContains = core.getInput("bodyContains");
const bodyDoesNotContain = core.getInput("bodyDoesNotContain");
//Check if a description is required
const allowEmpty = core.getInput("allowEmpty");
const allowEmpty = core.getInput("allowEmpty") === "true" ? true : false;
if (github_1.context.eventName !== "pull_request" &&
github_1.context.eventName !== "pull_request_target") {
// TODO(ApoorvGuptaAi) Should just return here and skip the rest of the check.
Expand All @@ -113,6 +113,7 @@ function run() {
const PRBody = pull_request === null || pull_request === void 0 ? void 0 : pull_request.body;
core.info("Checking body contents");
if (!PRBody) {
console.log(allowEmpty);
if (allowEmpty) {
core.warning("⚠️ The PR body is empty, skipping checks");
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function run() {
const bodyContains = core.getInput("bodyContains");
const bodyDoesNotContain = core.getInput("bodyDoesNotContain");
//Check if a description is required
const allowEmpty = core.getInput("allowEmpty");
const allowEmpty = core.getInput("allowEmpty") === "true"? true: false;

if (
context.eventName !== "pull_request" &&
Expand All @@ -74,6 +74,7 @@ async function run() {
const PRBody = pull_request?.body;
core.info("Checking body contents");
if (!PRBody) {
console.log(allowEmpty);
if(allowEmpty) {
core.warning("⚠️ The PR body is empty, skipping checks");
} else {
Expand Down

0 comments on commit b443b99

Please sign in to comment.