File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 ${{ runner.os }}-yarn-
2323
2424 - run : yarn install --frozen-lockfile
25+ - run : yarn lint
2526 - run : yarn build
2627 - run : yarn package
2728 - uses : actions/upload-artifact@v3
Original file line number Diff line number Diff line change 1717 "eslint-config-prettier" : " ^8.6.0" ,
1818 "eslint-plugin-prettier" : " ^4.2.1" ,
1919 "prettier" : " ^2.8.4" ,
20- "typescript" : " ^4.3.2 "
20+ "typescript" : " ^4.9.5 "
2121 },
2222 "scripts" : {
2323 "build" : " ncc build src/index.ts" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ import * as exec from "@actions/exec";
66import * as core from "@actions/core" ;
77import fs from "fs" ;
88
9+ const isENOENT = ( e : unknown ) : boolean => {
10+ return (
11+ typeof e === "object" && e !== null && "code" in e && e . code === "ENOENT"
12+ ) ;
13+ } ;
14+
915export class WindowsChannelInstaller implements Installer {
1016 constructor ( private readonly platform : Platform ) { }
1117
@@ -18,7 +24,7 @@ export class WindowsChannelInstaller implements Installer {
1824 try {
1925 await fs . promises . stat ( root ) ;
2026 } catch ( e ) {
21- if ( e . code === "ENOENT" ) {
27+ if ( isENOENT ( e ) ) {
2228 return undefined ;
2329 }
2430 throw e ;
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import * as installer from "./installer";
55import { getPlatform , OS } from "./platform" ;
66import path from "path" ;
77
8+ const hasErrorMessage = ( e : unknown ) : e is { message : string | Error } => {
9+ return typeof e === "object" && e !== null && "message" in e ;
10+ } ;
11+
812async function run ( ) : Promise < void > {
913 try {
1014 const version = core . getInput ( "chrome-version" ) || "latest" ;
@@ -26,7 +30,11 @@ async function run(): Promise<void> {
2630 await exec . exec ( binName , [ "--version" ] ) ;
2731 }
2832 } catch ( error ) {
29- core . setFailed ( error . message ) ;
33+ if ( hasErrorMessage ( error ) ) {
34+ core . setFailed ( error . message ) ;
35+ } else {
36+ core . setFailed ( String ( error ) ) ;
37+ }
3038 }
3139}
3240
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export const OS = {
1212} as const ;
1313
1414// eslint-disable-next-line no-redeclare
15- export type OS = typeof OS [ keyof typeof OS ] ;
15+ export type OS = ( typeof OS ) [ keyof typeof OS ] ;
1616
1717export const Arch = {
1818 AMD64 : "amd64" ,
@@ -21,7 +21,7 @@ export const Arch = {
2121} as const ;
2222
2323// eslint-disable-next-line no-redeclare
24- export type Arch = typeof Arch [ keyof typeof Arch ] ;
24+ export type Arch = ( typeof Arch ) [ keyof typeof Arch ] ;
2525
2626export const getOS = ( ) : OS => {
2727 const platform = os . platform ( ) ;
Original file line number Diff line number Diff line change @@ -1047,10 +1047,10 @@ type-fest@^0.20.2:
10471047 resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
10481048 integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
10491049
1050- typescript@^4.3.2 :
1051- version "4.3.2 "
1052- resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2 .tgz#399ab18aac45802d6f2498de5054fcbbe716a805 "
1053- integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw ==
1050+ typescript@^4.9.5 :
1051+ version "4.9.5 "
1052+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5 .tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a "
1053+ integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g ==
10541054
10551055uri-js@^4.2.2 :
10561056 version "4.4.0"
You can’t perform that action at this time.
0 commit comments