Skip to content

Commit

Permalink
Merge branch 'dev' into ✅-140
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Sep 9, 2024
2 parents 79d062e + b443b99 commit 7090b87
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
github-token:
description: "Github token, added magically."
allowEmpty:
description: "Boolean - true will only throw a warning if the body is empty, false will fail the run. Defaults to true."
description: "Boolean - true will only throw a warning if the body is empty, false will fail the run"
default: true
bodyContains:
description: "String or |-separated array of strings, one of which must be contained in the PR body, can be left blank or omitted"
Expand Down
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 7090b87

Please sign in to comment.