From b6a2c8482b3ae3f584dde675c70d403bd23ea515 Mon Sep 17 00:00:00 2001 From: Technote Date: Tue, 11 Feb 2020 18:12:55 +0900 Subject: [PATCH 1/2] fix: git tag --- __tests__/git-helper.test.ts | 4 ++-- src/command.ts | 4 +++- src/git-helper.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/__tests__/git-helper.test.ts b/__tests__/git-helper.test.ts index 08fefa04..74ddab51 100644 --- a/__tests__/git-helper.test.ts +++ b/__tests__/git-helper.test.ts @@ -493,7 +493,7 @@ describe('GitHelper', () => { await helper.fetchTags(workDir, context()); execCalledWith(mockExec, [ - 'git tag > /dev/null 2>&1', + 'git tag', 'git tag -d \'v1.2.3\' \'v1.2.4\' \'v1.2.5\' \'v1.2.6\' > /dev/null 2>&1', 'git fetch \'https://octocat:token1@github.com/hello/world.git\' --tags > /dev/null 2>&1', ]); @@ -506,7 +506,7 @@ describe('GitHelper', () => { await helper.fetchTags(workDir, context(), 3); execCalledWith(mockExec, [ - 'git tag > /dev/null 2>&1', + 'git tag', 'git tag -d \'v1.2.3\' \'v1.2.4\' \'v1.2.5\' > /dev/null 2>&1', 'git tag -d \'v1.2.6\' > /dev/null 2>&1', 'git fetch \'https://octocat:token1@github.com/hello/world.git\' --tags > /dev/null 2>&1', diff --git a/src/command.ts b/src/command.ts index 3bdc7b04..98b70522 100644 --- a/src/command.ts +++ b/src/command.ts @@ -110,7 +110,9 @@ export default class Command { const commandArgs = undefined === args ? '' : escape(args.map(item => item.trim()).filter(item => item.length)); const commandWithArgs = command + (commandArgs.length ? ' ' + commandArgs : ''); if (undefined !== altCommand) { - this.logger.displayCommand(altCommand); + if (altCommand) { + this.logger.displayCommand(altCommand); + } } else if (!quiet) { this.logger.displayCommand(commandWithArgs); } diff --git a/src/git-helper.ts b/src/git-helper.ts index a340dfb0..1da8155d 100644 --- a/src/git-helper.ts +++ b/src/git-helper.ts @@ -409,8 +409,8 @@ export default class GitHelper { */ public getTags = async(workDir: string, options?: { quiet?: boolean; suppressOutput?: boolean }): Promise => (await this.runCommand(workDir, { command: 'git tag', - quiet: options?.quiet, suppressOutput: options?.suppressOutput, + altCommand: options?.quiet ? '' : undefined, }))[0].stdout; /** From 164fc930d0f989b2c9d58fee8fe2dc0f5f1fd661 Mon Sep 17 00:00:00 2001 From: Technote Date: Tue, 11 Feb 2020 18:13:23 +0900 Subject: [PATCH 2/2] feat: Update package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8086df13..c22057dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@technote-space/github-action-helper", - "version": "1.1.0", + "version": "1.1.1", "description": "Helper to filter GitHub Action.", "author": { "name": "Technote",