From d68d2f2010d17f69267400f329baee761a8e8428 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Tue, 15 Dec 2020 18:18:20 +0100 Subject: [PATCH] fix: Fixed isShallow not working correctly anymore --- .github/workflows/test.yml | 5 +---- src/helpers/git.js | 12 +++++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffdcad9..3e25300 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,5 @@ name: 'Test the action' -on: - pull_request: - branches: - - master +on: [pull_request] jobs: test-json: diff --git a/src/helpers/git.js b/src/helpers/git.js index ff80ccb..188d2b4 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -119,14 +119,13 @@ module.exports = new (class Git { * @return {Promise<>} */ isShallow = async() => { - const isShallow = await this.exec('rev-parse --is-shallow-repository') - - // isShallow does not return anything on local machine - if (isShallow) { - return isShallow.trim().replace('\n', '') === 'true' - } else { + if (ENV === 'dont-use-git') { return false } + + const isShallow = await this.exec('rev-parse --is-shallow-repository') + + return isShallow.trim().replace('\n', '') === 'true' } /** @@ -155,7 +154,6 @@ module.exports = new (class Git { const expectedCommands = [ 'git config user.name "Conventional Changelog Action"', 'git config user.email "conventional.changelog.action@github.com"', - 'git rev-parse --is-shallow-repository', 'git pull --tags --ff-only', ]