Skip to content

Instantly share code, notes, and snippets.

@ardydedase
Created May 8, 2022 21:24
Show Gist options
  • Save ardydedase/b28bae3e883331e78fc5829564b4eb14 to your computer and use it in GitHub Desktop.
Save ardydedase/b28bae3e883331e78fc5829564b4eb14 to your computer and use it in GitHub Desktop.
import {danger, warn, fail} from 'danger';
const reviewLargePR = () => {
const bigPRThreshold = 300;
if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
warn(`:exclamation: Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR for faster, easier review.`);
}
}
const ensurePRHasAssignee = () => {
// Always ensure we assign someone, so that our Slackbot can do its work correctly
if (danger.github.pr.assignee === null) {
fail("Please assign someone to merge this PR, and optionally include people who should review.")
}
}
reviewLargePR();
ensurePRHasAssignee();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment