Skip to content

Commit

Permalink
Merge pull request #220 from technote-space/feature/#219
Browse files Browse the repository at this point in the history
feat: show build sha (#219)
  • Loading branch information
technote-space authored Feb 9, 2020
2 parents 74d0467 + 390ae16 commit ddce643
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions __tests__/context-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe('showActionInfo', () => {
stdoutCalledWith(mockStdout, [
'',
'==================================================',
'Version: v1.2.3',
'Version: v1.2.3(undefined)',
'Event: push',
'Action: rerequested',
'sha: test-sha',
Expand Down Expand Up @@ -288,7 +288,7 @@ describe('showActionInfo', () => {
stdoutCalledWith(mockStdout, [
'',
'==================================================',
'Version: hello/[email protected]',
'Version: hello/[email protected](162553222be3497f057501e028b47afc64944d84)',
'Event: push',
'Action: rerequested',
'sha: test-sha',
Expand Down
28 changes: 14 additions & 14 deletions __tests__/fixtures/build2.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"owner": "hello",
"repo": "world",
"sha": "ed968e840d10d2d313a870bc131a4e2c311d7ad09bdf32b3418147221f51a6e2",
"ref": "release/v1.2.3",
"tagName": "v1.2.3",
"branch": "gh-actions",
"tags": [
"v1.2.3",
"v1",
"v1.2"
],
"updated_at": "2020-01-01T01:23:45.000Z"
}
{
"owner": "hello",
"repo": "world",
"sha": "162553222be3497f057501e028b47afc64944d84",
"ref": "release/v1.2.3",
"tagName": "v1.2.3",
"branch": "gh-actions",
"tags": [
"v1.2.3",
"v1",
"v1.2"
],
"updated_at": "2020-01-01T01:23:45.000Z"
}
28 changes: 14 additions & 14 deletions __tests__/fixtures/test/build.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"owner": "hello",
"repo": "world",
"sha": "ed968e840d10d2d313a870bc131a4e2c311d7ad09bdf32b3418147221f51a6e2",
"ref": "release/v1.2.3",
"tagName": "v1.2.3",
"branch": "gh-actions",
"tags": [
"v1.2.3",
"v1",
"v1.2"
],
"updated_at": "2020-01-01T01:23:45.000Z"
}
{
"owner": "hello",
"repo": "world",
"sha": "162553222be3497f057501e028b47afc64944d84",
"ref": "release/v1.2.3",
"tagName": "v1.2.3",
"branch": "gh-actions",
"tags": [
"v1.2.3",
"v1",
"v1.2"
],
"updated_at": "2020-01-01T01:23:45.000Z"
}
2 changes: 1 addition & 1 deletion __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe('getBuildInfo', () => {
expect(getBuildInfo(path.resolve(__dirname, 'fixtures', 'build2.json'))).toEqual({
'owner': 'hello',
'repo': 'world',
'sha': 'ed968e840d10d2d313a870bc131a4e2c311d7ad09bdf32b3418147221f51a6e2',
'sha': '162553222be3497f057501e028b47afc64944d84',
'ref': 'release/v1.2.3',
'tagName': 'v1.2.3',
'branch': 'gh-actions',
Expand Down
4 changes: 2 additions & 2 deletions src/context-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const showActionInfo = (rootDir: string, logger: Logger, context: Context
logger.log(separator);
if (false !== info) {
if ('owner' in info) {
logger.log('Version: %s/%s@%s', info.owner, info.repo, info.tagName);
logger.log('Version: %s/%s@%s(%s)', info.owner, info.repo, info.tagName, info.sha);
} else {
logger.log('Version: %s', info.tagName);
logger.log('Version: %s(%s)', info.tagName, info.sha);
}
}
logger.log('Event: %s', context.eventName);
Expand Down

0 comments on commit ddce643

Please sign in to comment.