From 76d865884ce60f2f553171bae830b17161b03087 Mon Sep 17 00:00:00 2001 From: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:34:12 -0700 Subject: [PATCH] feat: Fail PRs that edit README.md (#441) fixes #436 --- dangerfile.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dangerfile.js b/dangerfile.js index 1896377..3088c55 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -5,6 +5,11 @@ const githubMetadata = danger.git.fileMatch('.github/**') const yamlData = danger.git.fileMatch('data/**') const scripts = danger.git.fileMatch('scripts/**') const src = danger.git.fileMatch('src/**') +const readme = danger.git.fileMatch('README.md') + +if (readme.edited) { + fail('Please do not edit the README directly. It is generated from the data in the data/ directory.') +} if (githubMetadata.edited) { message('Changes were made within the .github folder.')