Last active
January 14, 2022 16:00
-
-
Save TejasQ/e40590a6e101d34bc8138af1d86a6eb7 to your computer and use it in GitHub Desktop.
Dangerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { existsSync, readFileSync, writeFileSync, appendFileSync } = require("fs"); | |
const { join } = require("path"); | |
const { body } = danger.github.pr; | |
/* Fail if there's no description */ | |
if (!body.length) { | |
fail("Please add a description to this PR."); | |
} | |
/* Warn if no GIFs/Screenshots */ | |
const hasScreenshot = body.match(/\!\[(.*)\]\((.*)\)/) || body.match(/\.mov/g, /\.mp4/g); | |
if (!hasScreenshot) { | |
warn("Please consider adding a GIF or screenshot demonstrating the effects of this PR for more efficient reviews."); | |
} | |
export {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment