Skip to content

Commit 52bbbf0

Browse files
Merge pull request #217 from technote-space/release/v0.8.6
Release/v0.8.6
2 parents a620ee7 + 835452f commit 52bbbf0

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

__tests__/git-helper.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,20 +433,20 @@ describe('GitHelper', () => {
433433
describe('checkDiff', () => {
434434
it('should return true', async() => {
435435
setChildProcessParams({stdout: 'M file1\nA file2\nD file3\n file4\n\nB file5\n'});
436-
expect(await helper.checkDiff(workDir)).toBeTruthy();
436+
expect(await helper.checkDiff(workDir)).toBe(true);
437437
});
438438

439439
it('should return false', async() => {
440440
setChildProcessParams({stdout: ' file1\n\nB file2\n'});
441-
expect(await helper.checkDiff(workDir)).toBeFalsy();
441+
expect(await helper.checkDiff(workDir)).toBe(false);
442442
});
443443
});
444444

445445
describe('commit', () => {
446446
it('should do nothing', async() => {
447447
const mockExec = spyOnExec();
448448

449-
expect(await helper.commit(workDir, 'test message')).toBeFalsy();
449+
expect(await helper.commit(workDir, 'test message')).toBe(false);
450450

451451
execCalledWith(mockExec, [
452452
'git add --all',
@@ -458,7 +458,7 @@ describe('GitHelper', () => {
458458
setChildProcessParams({stdout: 'M file1\n\nM file2\n'});
459459
const mockExec = spyOnExec();
460460

461-
expect(await helper.commit(workDir, 'hello! how are you doing $USER "double" \'single\'')).toBeTruthy();
461+
expect(await helper.commit(workDir, 'hello! how are you doing $USER "double" \'single\'')).toBe(true);
462462

463463
execCalledWith(mockExec, [
464464
'git add --all',
@@ -476,11 +476,10 @@ describe('GitHelper', () => {
476476
count: 20,
477477
allowEmpty: true,
478478
args: ['--dry-run'],
479-
})).toBeTruthy();
479+
})).toBe(true);
480480

481481
execCalledWith(mockExec, [
482482
'git add --all',
483-
'git status --short -uno',
484483
'git commit --allow-empty --dry-run -qm test',
485484
'git show \'--stat-count=20\' HEAD',
486485
]);

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": "0.8.5",
3+
"version": "0.8.6",
44
"description": "Helper to filter GitHub Action.",
55
"author": {
66
"name": "Technote",

src/git-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export default class GitHelper {
361361
public commit = async(workDir: string, message: string, options?: { count?: number; allowEmpty?: boolean; args?: Array<string> }): Promise<boolean> => {
362362
await this.runCommand(workDir, {command: 'git add', args: ['--all']});
363363

364-
if (!await this.checkDiff(workDir)) {
364+
if (!options?.allowEmpty && !await this.checkDiff(workDir)) {
365365
this.logger.info('There is no diff.');
366366
return false;
367367
}

0 commit comments

Comments
 (0)