Update .rules to prompt for self-review before submitting PR (#62945)
Release Notes: - N/A
This commit is contained in:
1 parent
d6ec2f59ba
commit
ff54ece5b8
2 files changed
+12
-1
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { danger, message, warn, fail } from "danger";
|
||||
import { danger, message, warn, fail, schedule } from "danger";
|
||||
const { prHygiene } = require("danger-plugin-pr-hygiene");
|
||||
|
||||
prHygiene({
|
||||
@@ -61,6 +61,16 @@ if (includesIssueUrl) {
|
||||
);
|
||||
}
|
||||
|
||||
const readmeModified = danger.git.modified_files.includes("README.md") || danger.git.created_files.includes("README.md");
|
||||
if (readmeModified) {
|
||||
schedule(async () => {
|
||||
const readmeDiff = await danger.git.diffForFile("README.md");
|
||||
if (readmeDiff && readmeDiff.added.includes("Remove this line to confirm you've reviewed this PR before submitting.")) {
|
||||
fail("Please self-review your PR before submitting — README.md contains a line that asks to be removed which you should have spotted.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const SCHEMA_CHANGE_ATTESTATION =
|
||||
"The corresponding database schema migration has been created in the Cloud repo and applied to the production database.";
|
||||
|
||||
|
||||
Reference in new issue
Block a user