diff --git a/.github/workflows/cherry_diff.yml b/.github/workflows/cherry_diff.yml index db9c1391..08e10127 100644 --- a/.github/workflows/cherry_diff.yml +++ b/.github/workflows/cherry_diff.yml @@ -17,4 +17,4 @@ jobs: run: npm install - name: Raise if new JavaScript code is added - run: ./bin/cherry.js diff --metric='[loc] JavaScript' --api-key=${{ secrets.CHERRY_API_KEY }} --error-if-increase --quiet + run: ./bin/cherry.js diff --metric='[loc] JavaScript' --error-if-increase --quiet diff --git a/src/git.js b/src/git.js index bb3ed0af..c9dd2ab5 100644 --- a/src/git.js +++ b/src/git.js @@ -41,10 +41,8 @@ export const getDefaultBranchName = async () => { return defaultBranch.replace('origin/', '').trim() } -export const getMergeBase = async (currentBranchName, defaultBranchName) => { - const mergeBase = (await git(`merge-base ${currentBranchName} ${defaultBranchName}`)).toString() - return mergeBase.trim() -} +export const getMergeBase = async (currentBranchName, defaultBranchName) => + (await git(`merge-base ${currentBranchName} origin/${defaultBranchName}`)).toString().trim() export const authorName = async (sha) => (await git(`show ${sha} --format=%an --no-patch`))[0]