Skip to content

Instantly share code, notes, and snippets.

@TejasQ
Last active January 14, 2022 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TejasQ/e40590a6e101d34bc8138af1d86a6eb7 to your computer and use it in GitHub Desktop.
Save TejasQ/e40590a6e101d34bc8138af1d86a6eb7 to your computer and use it in GitHub Desktop.
Dangerfile
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