From 45b0e82a3d9ac5bcc74a5b69b7f1fe5697029b13 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Fri, 12 Feb 2021 21:30:45 +0100 Subject: [PATCH] Dangerfile: Trim merge base (#2761) --- dangerfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dangerfile.js b/dangerfile.js index 23e10750da..8063393244 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 () => {