mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-24 17:36:15 +00:00
ci(danger): add dangerjs for GitHub
Add GitHub workflow for running dangerjs on pull requests. Add GitHub layout for DangerJS.
This commit is contained in:
19
.github/dangerjs/prDescription.ts
vendored
Normal file
19
.github/dangerjs/prDescription.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
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."
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user