Commit 45b0e82a3d9ac5bcc74a5b69b7f1fe5697029b13

Michael Schmidt 2021-02-12T21:30:45

Dangerfile: Trim merge base (#2761)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/dangerfile.js b/dangerfile.js
index 23e1075..8063393 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -33,9 +33,9 @@ const getChangedFiles = async () => {
 	// Determine the merge base between master and the PR branch.
 	// If files changed in master since PR was branched they would show in the diff otherwise.
 	// https://stackoverflow.com/questions/25071579/list-all-files-changed-in-a-pull-request-in-git-github
-	const mergeBase = await git.raw(['merge-base', 'pr', 'HEAD']);
+	const mergeBase = (await git.raw(['merge-base', 'pr', 'HEAD'])).trim();
 	const result = await git.diff(['--name-only', '--no-renames', 'pr', mergeBase]);
-	return (result || '').split(/\r?\n/g);
+	return (result || '').trim().split(/\r?\n/g);
 };
 
 const getChangedMinifiedFiles = async () => {