Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.0.10 #11

Merged
merged 3 commits into from Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions __tests__/api-helper.test.ts
Expand Up @@ -266,7 +266,7 @@ describe('ApiHelper', () => {

expect(await helper.commit(path.resolve(__dirname, 'fixtures'), 'test commit message', ['build1.json', 'build2.json'], octokit, context)).toBeFalsy();

expect(mockStdout).toBeCalledWith('##[warning]Branch [test] is protected' + EOL);
expect(mockStdout).toBeCalledWith('##[warning]Branch [test] is protected.' + EOL);
});

it('should commit', async() => {
Expand All @@ -292,13 +292,13 @@ describe('ApiHelper', () => {
expect(mockStdout).toBeCalledTimes(10);
expect(mockStdout.mock.calls[0][0]).toBe('##[group]Start push to branch [test]' + EOL);
expect(mockStdout.mock.calls[1][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[2][0]).toBe('##[group]Creating blobs' + EOL);
expect(mockStdout.mock.calls[2][0]).toBe('##[group]Creating blobs...' + EOL);
expect(mockStdout.mock.calls[3][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[4][0]).toBe('##[group]Creating tree' + EOL);
expect(mockStdout.mock.calls[4][0]).toBe('##[group]Creating tree...' + EOL);
expect(mockStdout.mock.calls[5][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[6][0]).toBe('##[group]Creating commit [cd8274d15fa3ae2ab983129fb037999f264ba9a7]' + EOL);
expect(mockStdout.mock.calls[6][0]).toBe('##[group]Creating commit... [cd8274d15fa3ae2ab983129fb037999f264ba9a7]' + EOL);
expect(mockStdout.mock.calls[7][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[8][0]).toBe('##[group]Updating ref [heads%2Ftest] [7638417db6d59f3c431d3e1f261cc637155684cd]' + EOL);
expect(mockStdout.mock.calls[8][0]).toBe('##[group]Updating ref... [heads%2Ftest] [7638417db6d59f3c431d3e1f261cc637155684cd]' + EOL);
expect(mockStdout.mock.calls[9][0]).toBe('##[endgroup]' + EOL);
});
});
Expand Down Expand Up @@ -395,13 +395,13 @@ describe('ApiHelper with params', () => {
expect(mockStdout).toBeCalledTimes(10);
expect(mockStdout.mock.calls[0][0]).toBe('##[group]Start push to branch [test-branch]' + EOL);
expect(mockStdout.mock.calls[1][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[2][0]).toBe('##[group]Creating blobs' + EOL);
expect(mockStdout.mock.calls[2][0]).toBe('##[group]Creating blobs...' + EOL);
expect(mockStdout.mock.calls[3][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[4][0]).toBe('##[group]Creating tree' + EOL);
expect(mockStdout.mock.calls[4][0]).toBe('##[group]Creating tree...' + EOL);
expect(mockStdout.mock.calls[5][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[6][0]).toBe('##[group]Creating commit [cd8274d15fa3ae2ab983129fb037999f264ba9a7]' + EOL);
expect(mockStdout.mock.calls[6][0]).toBe('##[group]Creating commit... [cd8274d15fa3ae2ab983129fb037999f264ba9a7]' + EOL);
expect(mockStdout.mock.calls[7][0]).toBe('##[endgroup]' + EOL);
expect(mockStdout.mock.calls[8][0]).toBe('##[group]Updating ref [test-ref] [7638417db6d59f3c431d3e1f261cc637155684cd]' + EOL);
expect(mockStdout.mock.calls[8][0]).toBe('##[group]Updating ref... [test-ref] [7638417db6d59f3c431d3e1f261cc637155684cd]' + EOL);
expect(mockStdout.mock.calls[9][0]).toBe('##[endgroup]' + EOL);
});
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@technote-space/github-action-helper",
"version": "0.0.9",
"version": "0.0.10",
"description": "Helper to filter GitHub Action.",
"author": "Technote <technote.space@gmail.com> (https://technote.space)",
"license": "MIT",
Expand Down
10 changes: 5 additions & 5 deletions src/api-helper.ts
Expand Up @@ -176,22 +176,22 @@ export default class ApiHelper {
}

if (await this.checkProtected(octokit, context)) {
this.logger.warn('Branch [%s] is protected', this.getBranch(context));
this.logger.warn('Branch [%s] is protected.', this.getBranch(context));
return false;
}

this.logger.startProcess('Start push to branch [%s]', this.getBranch(context));

this.logger.startProcess('Creating blobs');
this.logger.startProcess('Creating blobs...');
const blobs = await this.filesToBlobs(rootDir, files, octokit, context);

this.logger.startProcess('Creating tree');
this.logger.startProcess('Creating tree...');
const tree = await this.createTree(blobs, octokit, context);

this.logger.startProcess('Creating commit [%s]', tree.data.sha);
this.logger.startProcess('Creating commit... [%s]', tree.data.sha);
const commit = await this.createCommit(commitMessage, tree, octokit, context);

this.logger.startProcess('Updating ref [%s] [%s]', this.getRefForUpdate(context), commit.data.sha);
this.logger.startProcess('Updating ref... [%s] [%s]', this.getRefForUpdate(context), commit.data.sha);
await this.updateRef(commit, octokit, context);

this.logger.endProcess();
Expand Down