Skip to content

Commit

Permalink
fix: bump typescript from 4.3.2 to 4.9.5 (browser-actions#314)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shin'ya Ueoka <ueokande@i-beam.org>
  • Loading branch information
dependabot[bot] and ueokande authored Feb 12, 2023
1 parent e700d17 commit a5f9494
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build
- run: yarn package
- uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.4",
"typescript": "^4.3.2"
"typescript": "^4.9.5"
},
"scripts": {
"build": "ncc build src/index.ts",
Expand Down
8 changes: 7 additions & 1 deletion src/channel_windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import * as exec from "@actions/exec";
import * as core from "@actions/core";
import fs from "fs";

const isENOENT = (e: unknown): boolean => {
return (
typeof e === "object" && e !== null && "code" in e && e.code === "ENOENT"
);
};

export class WindowsChannelInstaller implements Installer {
constructor(private readonly platform: Platform) {}

Expand All @@ -18,7 +24,7 @@ export class WindowsChannelInstaller implements Installer {
try {
await fs.promises.stat(root);
} catch (e) {
if (e.code === "ENOENT") {
if (isENOENT(e)) {
return undefined;
}
throw e;
Expand Down
10 changes: 9 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import * as installer from "./installer";
import { getPlatform, OS } from "./platform";
import path from "path";

const hasErrorMessage = (e: unknown): e is { message: string | Error } => {
return typeof e === "object" && e !== null && "message" in e;
};

async function run(): Promise<void> {
try {
const version = core.getInput("chrome-version") || "latest";
Expand All @@ -26,7 +30,11 @@ async function run(): Promise<void> {
await exec.exec(binName, ["--version"]);
}
} catch (error) {
core.setFailed(error.message);
if (hasErrorMessage(error)) {
core.setFailed(error.message);
} else {
core.setFailed(String(error));
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const OS = {
} as const;

// eslint-disable-next-line no-redeclare
export type OS = typeof OS[keyof typeof OS];
export type OS = (typeof OS)[keyof typeof OS];

export const Arch = {
AMD64: "amd64",
Expand All @@ -21,7 +21,7 @@ export const Arch = {
} as const;

// eslint-disable-next-line no-redeclare
export type Arch = typeof Arch[keyof typeof Arch];
export type Arch = (typeof Arch)[keyof typeof Arch];

export const getOS = (): OS => {
const platform = os.platform();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1047,10 +1047,10 @@ type-fest@^0.20.2:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==

typescript@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
typescript@^4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

uri-js@^4.2.2:
version "4.4.0"
Expand Down

0 comments on commit a5f9494

Please sign in to comment.