Skip to content

Commit

Permalink
Merge pull request #65 from Cyberbeni/remove-warning
Browse files Browse the repository at this point in the history
use info log instead of warning
  • Loading branch information
Cyberbeni authored Oct 9, 2020
2 parents 63f2d85 + a4565db commit f595d3c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/helpers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion lib/installer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "install-swift-tool",
"version": "2.1.6",
"version": "2.1.7",
"description": "Install swift based tools inside a GitHub Action.",
"main": "lib/installer.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function getUuid(url: string, commitHash: string): Promise<string>
if (os.version != undefined) {
osVersion = os.version()
} else {
core.warning('os.version undefined, using `uname -v` instead')
core.info('os.version undefined, using `uname -v` instead')
osVersion = await exec('uname', ['-v']) // os.version is somehow undefined on GitHub runner
}
const swiftVersion = await exec('swift', ['-version'])
Expand Down
7 changes: 6 additions & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ export class SwiftToolInstaller {
} else {
await exec('git', ['clone', '--depth', '1', this.url, this.workingDirectory])
}
const commitHash = await exec('git', ['-C', this.workingDirectory,'rev-parse', 'HEAD'])
// `git rev-parse HEAD` gave different result than `git ls-remote -ht ...`
// when used with an annotated tag: https://stackoverflow.com/a/15472310
// This seems to print the same hash(es) but only if `git clone` used `--depth 1`
const commitHash = (await exec('git', ['-C', this.workingDirectory,'show-ref', '-s']))
.split('\n')
.pop() ?? ''
const newUuid = await getUuid(this.url, commitHash)
if (this.uuid != newUuid) {
const oldWorkingDirectory = this.workingDirectory
Expand Down

0 comments on commit f595d3c

Please sign in to comment.