Skip to content

Commit a73286d

Browse files
Merge pull request #354 from technote-space/release/next-v4.4.11
release: v5.0.0
2 parents 9dd2ebc + ac01f71 commit a73286d

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

__tests__/git-helper.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ describe('GitHelper', () => {
653653
await helper.push(workDir, 'test-branch', context(), {withTag: true, args: ['--prune', '--verbose']});
654654

655655
execCalledWith(mockExec, [
656-
'git push --tags --prune --verbose \'https://octocat:[email protected]/hello/world.git\' \'test-branch:refs/heads/test-branch\' || :',
656+
'git push --tags --prune --verbose \'https://octocat:[email protected]/hello/world.git\' \'test-branch:refs/heads/test-branch\'',
657657
]);
658658
});
659659

@@ -663,7 +663,7 @@ describe('GitHelper', () => {
663663
await helper.push(workDir, 'test-branch', context());
664664

665665
execCalledWith(mockExec, [
666-
'git push \'https://octocat:[email protected]/hello/world.git\' \'test-branch:refs/heads/test-branch\' || :',
666+
'git push \'https://octocat:[email protected]/hello/world.git\' \'test-branch:refs/heads/test-branch\'',
667667
]);
668668
});
669669
});
@@ -675,7 +675,7 @@ describe('GitHelper', () => {
675675
await helper.forcePush(workDir, 'test-branch', context());
676676

677677
execCalledWith(mockExec, [
678-
'git push --force \'https://octocat:[email protected]/hello/world.git\' \'test-branch:refs/heads/test-branch\' || :',
678+
'git push --force \'https://octocat:[email protected]/hello/world.git\' \'test-branch:refs/heads/test-branch\'',
679679
]);
680680
});
681681
});

__tests__/utils2.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,16 @@ describe('replaceVariables', () => {
267267
describe('isCommandDebug', () => {
268268
testEnv();
269269

270-
it('should return true', () => {
270+
it('should return true 1', () => {
271271
process.env.INPUT_UTILS_COMMAND_DEBUG = 'true';
272272
expect(isCommandDebug()).toBe(true);
273273
});
274274

275+
it('should return true 2', () => {
276+
process.env.UTILS_COMMAND_DEBUG = 'true';
277+
expect(isCommandDebug()).toBe(true);
278+
});
279+
275280
it('should return false 1', () => {
276281
expect(isCommandDebug()).toBe(false);
277282
});
@@ -290,6 +295,11 @@ describe('isCommandDebug', () => {
290295
process.env.INPUT_UTILS_COMMAND_DEBUG = 'abc';
291296
expect(isCommandDebug()).toBe(false);
292297
});
298+
299+
it('should return false 5', () => {
300+
process.env.UTILS_COMMAND_DEBUG = '';
301+
expect(isCommandDebug()).toBe(false);
302+
});
293303
});
294304

295305
describe('isOutputDebug', () => {

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.4.11",
3+
"version": "5.0.0",
44
"description": "Helper for GitHub Action.",
55
"keywords": [
66
"github",

src/git-helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ export default class GitHelper {
563563
args: args.concat([this.getRemote(context), `${branch}:refs/heads/${branch}`]),
564564
stderrToStdout: this.isQuiet(),
565565
altCommand: `git push ${args.concat([this.getRemoteName(), `${branch}:refs/heads/${branch}`]).join(' ')}`,
566-
suppressError: this.shouldSuppressError(),
567566
});
568567
};
569568

src/utils.ts

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

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

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

260260
// eslint-disable-next-line @typescript-eslint/no-explicit-any
261261
export const objectGet = <T>(value: { [key: string]: any } | undefined | null, key: string, defaultValue?: T): T | undefined => {

0 commit comments

Comments
 (0)