Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Aug 9, 2023
1 parent 38715b7 commit 8fe66d8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dist/lib/checksum.js

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

2 changes: 1 addition & 1 deletion dist/lib/checksum.js.map

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

6 changes: 3 additions & 3 deletions dist/lib/install.js

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

7 changes: 4 additions & 3 deletions dist/setup.js

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

2 changes: 1 addition & 1 deletion dist/setup.js.map

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

2 changes: 1 addition & 1 deletion dist/verify.js

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

2 changes: 1 addition & 1 deletion src/lib/checksum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function getNotationCheckSum(version: string): string {
return checksum;
}
}
throw new Error(`Notation release does not support user input version ${version}`);
throw new Error(`Notation CLI release does not support user input version ${version}`);
}

// hash computes SH256 of file at path.
Expand Down
6 changes: 3 additions & 3 deletions src/lib/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function getConfigHome(): string {
case 'linux':
return process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : path.join(os.homedir(), '.config');
default:
throw new Error(`Unknown platform: ${platform}`);
throw new Error(`unknown platform: ${platform}`);
}
}

Expand All @@ -58,7 +58,7 @@ export function getPlatform(): string {
case 'win32':
return 'windows';
default:
throw new Error(`Unsupported platform: ${platform}`);
throw new Error(`unsupported platform: ${platform}`);
}
}

Expand All @@ -71,7 +71,7 @@ export function getArch(): string {
case 'arm64':
return 'arm64';
default:
throw new Error(`Unsupported architecture: ${architecture}`);
throw new Error(`unsupported architecture: ${architecture}`);
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ async function setup(): Promise<void> {

// download Notation CLI and validate checksum
const downloadURL = getNotationDownloadURL(version, notation_url);
console.log(`Downloading Notation CLI from ${downloadURL}`);
console.log(`downloading Notation CLI from ${downloadURL}`);
const pathToTarball: string = await tc.downloadTool(downloadURL);
console.log("downloading Notation CLI completed")
const sha256 = await hash(pathToTarball);
const groundTruth = notation_url ? notation_checksum : getNotationCheckSum(version);
if (sha256 !== groundTruth) {
throw new Error(`checksum of downloaded Notation CLI ${sha256} does not match ground truth ${groundTruth}`);
}
console.log("Successfully checked download checksum against ground truth")
console.log("successfully checked download checksum against ground truth")

// extract the tarball/zipball onto host runner
const extract = downloadURL.endsWith('.zip') ? tc.extractZip : tc.extractTar;
Expand All @@ -52,7 +53,7 @@ async function setup(): Promise<void> {
if (e instanceof Error) {
core.setFailed(e);
} else {
core.setFailed('Unknown error during notation setup');
core.setFailed('unknown error during notation setup');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function verify(): Promise<void> {
if (e instanceof Error) {
core.setFailed(e);
} else {
core.setFailed('Unknown error during notation verify');
core.setFailed('unknown error during notation verify');
}
}
}
Expand Down

0 comments on commit 8fe66d8

Please sign in to comment.