diff --git a/docs/danger.md b/docs/danger.md index 5cf34ac055..536732a0b0 100644 --- a/docs/danger.md +++ b/docs/danger.md @@ -22,7 +22,7 @@ Here are the checks that Danger does so far: - PR description is not empty - Big PR got a warning to recommend to split -- PR contains a file for towncrier and extension is checked +- PR contains a correct title and a label to categorize the release note - PR does not modify frozen classes - PR contains a Sign-Off, with exception for Element employee contributors - PR with change on layout should include screenshot in the description (TODO Not supported yet!) diff --git a/tools/danger/dangerfile.js b/tools/danger/dangerfile.js index b9f46d5666..024e661c67 100644 --- a/tools/danger/dangerfile.js +++ b/tools/danger/dangerfile.js @@ -27,30 +27,14 @@ if (editedFiles.length > 50) { message("This pull request seems relatively large. Please consider splitting it into multiple smaller ones.") } -// Request a changelog for each PR -const changelogAllowList = [ - "dependabot[bot]", -] +// Request a correct title for each PR +if (pr.title.endsWith("…")) { + fail("Please provide a complete title that can be used as a changelog entry.") +} -const requiresChangelog = !changelogAllowList.includes(user) - -if (requiresChangelog) { - const changelogFiles = editedFiles.filter(file => file.startsWith("changelog.d/")) - - if (changelogFiles.length == 0) { - warn("Please add a changelog. See instructions [here](https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#changelog)") - } else { - const validTowncrierExtensions = [ - "bugfix", - "doc", - "feature", - "misc", - "wip", - ] - if (!changelogFiles.every(file => validTowncrierExtensions.includes(file.split(".").pop()))) { - fail("Invalid extension for changelog. See instructions [here](https://github.com/element-hq/element-android/blob/develop/CONTRIBUTING.md#changelog)") - } - } +// Request a `PR-` label for each PR +if (pr.labels.filter((label) => label.name.startsWith("PR-")).length != 1) { + fail("Please add a `PR-` label to categorise the changelog entry.") } // check that frozen classes have not been modified