esp-idf/.github/dangerjs/prDescription.ts
Tomas Sebestik 7add582eb7 ci(danger): add dangerjs for GitHub
Add GitHub workflow for running dangerjs on pull requests.
Add GitHub layout for DangerJS.
2023-05-29 08:23:04 +02:00

20 lines
676 B
TypeScript

import { DangerDSLType, DangerResults } from "danger";
declare const danger: DangerDSLType;
declare const warn: (message: string, results?: DangerResults) => void;
/**
* Check if pull request has has a sufficiently accurate description
*
* @dangerjs WARN
*/
export default function (): void {
const prDescription: string = danger.github.pr.body;
const shortPrDescriptionThreshold: number = 100; // Description is considered too short below this number of characters
if (prDescription.length < shortPrDescriptionThreshold) {
return warn(
"The PR description looks very brief, please check if more details can be added."
);
}
}