From 208adf42c8c5b798eca2d0cb79d3802c653251be Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Mon, 29 Mar 2021 17:09:18 +0200 Subject: [PATCH] Ignore error when some tag on remote was updated --- dist/index.js | 4 +++- src/git.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index e516c4f..2090549 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3879,7 +3879,9 @@ async function getChangesSinceMergeBase(base, ref, initialFetchDepth) { if (baseRef === undefined) { baseRef = await getFullRef(base); if (baseRef === undefined) { - await exec_1.default('git', ['fetch', '--tags', `--depth=1`, 'origin', base, ref]); + await exec_1.default('git', ['fetch', '--tags', '--depth=1', 'origin', base, ref], { + ignoreReturnCode: true // returns exit code 1 if tags on remote were updated - we can safely ignore it + }); baseRef = await getFullRef(base); if (baseRef === undefined) { throw new Error(`Could not determine what is ${base} - fetch works but it's not a branch or tag`); diff --git a/src/git.ts b/src/git.ts index 97a4021..ca652e8 100644 --- a/src/git.ts +++ b/src/git.ts @@ -71,7 +71,9 @@ export async function getChangesSinceMergeBase(base: string, ref: string, initia if (baseRef === undefined) { baseRef = await getFullRef(base) if (baseRef === undefined) { - await exec('git', ['fetch', '--tags', `--depth=1`, 'origin', base, ref]) + await exec('git', ['fetch', '--tags', '--depth=1', 'origin', base, ref], { + ignoreReturnCode: true // returns exit code 1 if tags on remote were updated - we can safely ignore it + }) baseRef = await getFullRef(base) if (baseRef === undefined) { throw new Error(`Could not determine what is ${base} - fetch works but it's not a branch or tag`)