diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a6326d..f5ec1ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,8 @@ jobs: runs-on: 'ubuntu-latest' steps: - uses: 'actions/checkout@v2' + with: + fetch-depth: 0 - name: 'Use Docker' uses: 'actions-hub/docker/cli@master' diff --git a/cli/services/GitAffected.ts b/cli/services/GitAffected.ts index 3eb7bfc..20d783a 100644 --- a/cli/services/GitAffected.ts +++ b/cli/services/GitAffected.ts @@ -29,10 +29,14 @@ export class GitAffected implements GitAffectedOptions { base: string, head: string ): Promise { - const { stdout } = await execa.command( - `git diff --name-only --relative ${base} ${head}` - ) - return this.parseGitOutput(stdout) + try { + const { stdout } = await execa.command( + `git diff --name-only --relative ${base} ${head}` + ) + return this.parseGitOutput(stdout) + } catch { + return [] + } } public async getUncommittedFiles (): Promise {