From 7a458377d6d76769796357bf39e3accdb84f1342 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 8 Jun 2022 11:38:53 +0100 Subject: [PATCH] Fix Danger's changelog detection. --- Dangerfile.swift | 4 ++-- changelog.d/74.build | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/74.build diff --git a/Dangerfile.swift b/Dangerfile.swift index f4256cccf..014fd6f11 100644 --- a/Dangerfile.swift +++ b/Dangerfile.swift @@ -17,9 +17,9 @@ if danger.github.pullRequest.body?.isEmpty ?? true { // Request a changelog for each app change let editedFiles = danger.git.modifiedFiles + danger.git.createdFiles -let hasChangelog = danger.git.modifiedFiles.contains("/changelog.d") +let changelogFiles = editedFiles.filter { $0.hasPrefix("changelog.d/") } -if editedFiles.count > 0 && !hasChangelog { +if editedFiles.count > 0 && changelogFiles.isEmpty { warn("Please add a changelog.") } diff --git a/changelog.d/74.build b/changelog.d/74.build new file mode 100644 index 000000000..c29baec9d --- /dev/null +++ b/changelog.d/74.build @@ -0,0 +1 @@ +Fix Danger's changelog detection.