Skip to content
Go to file
Cannot retrieve contributors at this time
50 lines (42 sloc) 1.87 KB
// Because we don't get to use the d.ts, we can pass in a subset here.
// This means we can re-use the type infra from the app, without having to
// fake the import.
import yarn from "danger-plugin-yarn"
import jest from "danger-plugin-jest"
import { DangerDSLType } from "./source/dsl/DangerDSL"
declare var danger: DangerDSLType
// declare var results: any
declare function warn(message: string, file?: string, line?: number): void
// declare function fail(params: string): void
// declare function message(params: string): void
// declare function markdown(params: string): void
// declare function schedule(promise: Promise<any | void>): void
// declare function schedule(promise: () => Promise<any | void>): void
// declare function schedule(callback: (resolve: any) => void): void
export default async () => {
if (!danger.github) {
// Request a CHANGELOG entry if not declared #trivial
const hasChangelog = danger.git.modified_files.includes("")
const isTrivial = ( +"#trivial")
const isUser = danger.github!.pr.user.type === "User"
// Politely ask for their name on the entry too
if (!hasChangelog && !isTrivial && !isUser) {
const changelogDiff = await danger.git.diffForFile("")
const contributorName =
if (changelogDiff && changelogDiff.diff.includes(contributorName)) {
warn("Please add your GitHub name to the changelog entry, so we can attribute you correctly.")
// Some libraries
await yarn()
await jest()
// Don't have folks setting the package json version
const packageDiff = await danger.git.JSONDiffForFile("package.json")
if (packageDiff.version && !== "orta") {
fail("Please don't make package version changes")
// Re-run the git push hooks
import "./dangerfile.lite"
You can’t perform that action at this time.