Skip to content

Commit 6df633b

Browse files
Merge pull request #336 from technote-space/release/next-v4.3.0
release: v4.3.1
2 parents 6716b1d + 14b7880 commit 6df633b

File tree

5 files changed

+35
-35
lines changed

5 files changed

+35
-35
lines changed

__tests__/git-helper.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -930,9 +930,9 @@ describe('Debug', () => {
930930
});
931931

932932
it('should not add command to suppress error', async() => {
933-
process.env.ACTIONS_UTILS_DEBUG = 'true';
934-
const mockExec = spyOnSpawn();
935-
const mockStdout = spyOnStdout();
933+
process.env.INPUT_UTILS_COMMAND_DEBUG = 'true';
934+
const mockExec = spyOnSpawn();
935+
const mockStdout = spyOnStdout();
936936
mockExec.mockImplementation(() => {
937937
const error: ExecException = new Error('test error');
938938
error.code = 123;
@@ -952,9 +952,9 @@ describe('Debug', () => {
952952
});
953953

954954
it('should not add command to suppress error output', async() => {
955-
process.env.ACTIONS_STEP_DEBUG = 'true';
956-
const mockExec = spyOnSpawn();
957-
const mockStdout = spyOnStdout();
955+
process.env.INPUT_UTILS_OUTPUT_DEBUG = 'true';
956+
const mockExec = spyOnSpawn();
957+
const mockStdout = spyOnStdout();
958958
mockExec.mockImplementation(() => {
959959
const error: ExecException = new Error('test error');
960960
error.code = 123;

__tests__/utils2.test.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import {testEnv} from '@technote-space/github-action-test-helper';
33
import {Utils} from '../src';
44

5-
const {generateNewPatchVersion, generateNewMinorVersion, generateNewMajorVersion, arrayChunk, versionCompare, mask, isActionsStepDebug} = Utils;
6-
const {isBranch, isTagRef, normalizeRef, trimRef, getTag, getRefspec, getRemoteRefspec, getLocalRefspec, getOctokit, replaceVariables, isDebug} = Utils;
5+
const {generateNewPatchVersion, generateNewMinorVersion, generateNewMajorVersion, arrayChunk, versionCompare, isCommandDebug, isOutputDebug} = Utils;
6+
const {isBranch, isTagRef, normalizeRef, trimRef, getTag, getRefspec, getRemoteRefspec, getLocalRefspec, getOctokit, replaceVariables, mask} = Utils;
77

88
jest.useFakeTimers();
99

@@ -264,58 +264,58 @@ describe('replaceVariables', () => {
264264
});
265265
});
266266

267-
describe('isDebug', () => {
267+
describe('isCommandDebug', () => {
268268
testEnv();
269269

270270
it('should return true', () => {
271-
process.env.ACTIONS_UTILS_DEBUG = 'true';
272-
expect(isDebug()).toBe(true);
271+
process.env.INPUT_UTILS_COMMAND_DEBUG = 'true';
272+
expect(isCommandDebug()).toBe(true);
273273
});
274274

275275
it('should return false 1', () => {
276-
expect(isDebug()).toBe(false);
276+
expect(isCommandDebug()).toBe(false);
277277
});
278278

279279
it('should return false 2', () => {
280-
process.env.ACTIONS_UTILS_DEBUG = '';
281-
expect(isDebug()).toBe(false);
280+
process.env.INPUT_UTILS_COMMAND_DEBUG = '';
281+
expect(isCommandDebug()).toBe(false);
282282
});
283283

284284
it('should return false 3', () => {
285-
process.env.ACTIONS_UTILS_DEBUG = '1';
286-
expect(isDebug()).toBe(false);
285+
process.env.INPUT_UTILS_COMMAND_DEBUG = '1';
286+
expect(isCommandDebug()).toBe(false);
287287
});
288288

289289
it('should return false 4', () => {
290-
process.env.ACTIONS_UTILS_DEBUG = 'abc';
291-
expect(isDebug()).toBe(false);
290+
process.env.INPUT_UTILS_COMMAND_DEBUG = 'abc';
291+
expect(isCommandDebug()).toBe(false);
292292
});
293293
});
294294

295-
describe('isActionsStepDebug', () => {
295+
describe('isOutputDebug', () => {
296296
testEnv();
297297

298298
it('should return true', () => {
299-
process.env.ACTIONS_STEP_DEBUG = 'true';
300-
expect(isActionsStepDebug()).toBe(true);
299+
process.env.INPUT_UTILS_OUTPUT_DEBUG = 'true';
300+
expect(isOutputDebug()).toBe(true);
301301
});
302302

303303
it('should return false 1', () => {
304-
expect(isActionsStepDebug()).toBe(false);
304+
expect(isOutputDebug()).toBe(false);
305305
});
306306

307307
it('should return false 2', () => {
308-
process.env.ACTIONS_STEP_DEBUG = '';
309-
expect(isActionsStepDebug()).toBe(false);
308+
process.env.INPUT_UTILS_OUTPUT_DEBUG = '';
309+
expect(isOutputDebug()).toBe(false);
310310
});
311311

312312
it('should return false 3', () => {
313-
process.env.ACTIONS_STEP_DEBUG = '1';
314-
expect(isActionsStepDebug()).toBe(false);
313+
process.env.INPUT_UTILS_OUTPUT_DEBUG = '1';
314+
expect(isOutputDebug()).toBe(false);
315315
});
316316

317317
it('should return false 4', () => {
318-
process.env.ACTIONS_STEP_DEBUG = 'abc';
319-
expect(isActionsStepDebug()).toBe(false);
318+
process.env.INPUT_UTILS_OUTPUT_DEBUG = 'abc';
319+
expect(isOutputDebug()).toBe(false);
320320
});
321321
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "Helper for GitHub Action.",
55
"keywords": [
66
"github",

src/git-helper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
getAccessToken,
1616
generateNewMinorVersion,
1717
generateNewMajorVersion,
18-
isDebug,
19-
isActionsStepDebug,
18+
isCommandDebug,
19+
isOutputDebug,
2020
} from './utils';
2121
import {getGitUrlWithToken} from './context-helper';
2222

@@ -68,12 +68,12 @@ export default class GitHelper {
6868
/**
6969
* @return {boolean} should suppress error
7070
*/
71-
private shouldSuppressError = (): boolean => !isDebug();
71+
private shouldSuppressError = (): boolean => !isCommandDebug();
7272

7373
/**
7474
* @return {boolean} is quiet?
7575
*/
76-
private isQuiet = (): boolean => !isActionsStepDebug() && (!this.origin || this.quietIfNotOrigin);
76+
private isQuiet = (): boolean => !isOutputDebug() && (!this.origin || this.quietIfNotOrigin);
7777

7878
/**
7979
* @param {string} workDir work dir

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,6 @@ export const replaceVariables = async(string: string, variables: { key: string;
253253
return replaced;
254254
};
255255

256-
export const isDebug = (): boolean => process.env.ACTIONS_UTILS_DEBUG === 'true';
256+
export const isCommandDebug = (): boolean => getInput('UTILS_COMMAND_DEBUG') === 'true';
257257

258-
export const isActionsStepDebug = (): boolean => process.env.ACTIONS_STEP_DEBUG === 'true';
258+
export const isOutputDebug = (): boolean => getInput('UTILS_OUTPUT_DEBUG') === 'true';

0 commit comments

Comments
 (0)