Skip to content

Commit

Permalink
Minor 📝
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Nov 11, 2023
1 parent 11e14a5 commit fd19817
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ function run() {
const pull_request = payload.pull_request;
const repository = payload.repository;
if (!pull_request) {
core.setFailed("Expecting pull_request metadata.");
core.setFailed("Expecting pull_request metadata.");
return;
}
if (!repository) {
core.setFailed("Expecting repository metadata.");
core.setFailed("Expecting repository metadata.");
return;
}
if (bodyContains || bodyDoesNotContain) {
const PRBody = pull_request === null || pull_request === void 0 ? void 0 : pull_request.body;
core.info("Checking body contents");
// NOTE(apoorv) Its valid to have PRs with no body, so maybe that should not fail validation?
if (!PRBody) {
core.setFailed("The body is empty, can't check");
core.setFailed("The body is empty, can't check");
}
else {
if (bodyContains && !(0, utils_1.rexify)(bodyContains).test(PRBody)) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ async function run() {
const pull_request = payload.pull_request;
const repository = payload.repository;
if (!pull_request) {
core.setFailed("Expecting pull_request metadata.")
core.setFailed("Expecting pull_request metadata.")
return;
}
if (!repository) {
core.setFailed("Expecting repository metadata.")
core.setFailed("Expecting repository metadata.")
return;
}
if (bodyContains || bodyDoesNotContain) {
const PRBody = pull_request?.body;
core.info("Checking body contents");
// NOTE(apoorv) Its valid to have PRs with no body, so maybe that should not fail validation?
if (!PRBody) {
core.setFailed("The body is empty, can't check");
core.setFailed("The body is empty, can't check");
} else {
if (bodyContains && !rexify(bodyContains).test(PRBody)) {
core.setFailed(
Expand Down

0 comments on commit fd19817

Please sign in to comment.