Skip to content

Commit

Permalink
πŸ’š (danger) [DSDK-500]: Fix danger scripts (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman authored Oct 3, 2024
2 parents 5e224ba + 6bb0299 commit abbb326
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
13 changes: 8 additions & 5 deletions danger/dangerfile-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ console.log("PR Actor:", author);

checkIfBot(danger.github.pr.user);

let successful = true;
const results: boolean[] = [];

let fork = isFork(danger.github.pr);

successful = checkBranches(danger, fail, fork);
results.push(checkBranches(danger, fail, fork));

results.push(checkCommits(danger, fail, fork));

successful = checkCommits(danger, fail, fork);
results.push(checkTitle(danger, fail, fork));

successful = checkTitle(danger, fail, fork);
results.push(checkChangesets(danger, message));

successful = checkChangesets(danger, message);
const successful = results.every((result) => result === true);

if (successful) {
message("Danger: All checks passed successfully! πŸŽ‰", { icon: "βœ…" });
Expand Down
10 changes: 6 additions & 4 deletions danger/dangerfile-local-fork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import {
const author = getAuthor(danger);
console.log("PR Actor:", author);

let successful = true;
const results: boolean[] = [];

successful = checkBranches(danger, fail, true);
results.push(checkBranches(danger, fail, true));

successful = checkCommits(danger, fail, true);
results.push(checkCommits(danger, fail, true));

successful = checkChangesets(danger, message);
results.push(checkChangesets(danger, message));

const successful = results.every((result) => result === true);

if (successful) {
message("Danger: All checks passed successfully! πŸŽ‰", { icon: "βœ…" });
Expand Down
10 changes: 6 additions & 4 deletions danger/dangerfile-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import {
const author = getAuthor(danger);
console.log("PR Actor:", author);

let successful = true;
const results: boolean[] = [];

successful = checkBranches(danger, fail);
results.push(checkBranches(danger, fail));

successful = checkCommits(danger, fail);
results.push(checkCommits(danger, fail));

successful = checkChangesets(danger, message);
results.push(checkChangesets(danger, message));

const successful = results.every((result) => result === true);

if (successful) {
message("Danger: All checks passed successfully! πŸŽ‰", { icon: "βœ…" });
Expand Down

0 comments on commit abbb326

Please sign in to comment.