diff --git a/package.json b/package.json index f04e3e0f..48a85a85 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@semantic-release/git": "10.0.1", "@semantic-release/github": "8.0.7", "@semantic-release/npm": "9.0.2", + "@tsconfig/node16": "1.0.3", "@types/node": "16.18.23", "@typescript-eslint/eslint-plugin": "5.59.0", "@typescript-eslint/parser": "5.59.0", diff --git a/src/input.ts b/src/input.ts index 18157b77..9ae45f69 100644 --- a/src/input.ts +++ b/src/input.ts @@ -31,7 +31,9 @@ class Input { ? new RegExp(envRegexInput) : this.options.envRegex; this._environmentVariables = new Map( - Object.entries(process.env).filter(([key]) => envRegex.test(key)) + Object.entries(process.env) + .filter(([key]) => envRegex.test(key)) + .filter((pair): pair is [string, string] => pair[1] !== undefined) ); this.token = this.get( diff --git a/src/renovate.ts b/src/renovate.ts index aed10203..f73a249f 100644 --- a/src/renovate.ts +++ b/src/renovate.ts @@ -22,12 +22,13 @@ class Renovate { .map((e) => `--env ${e.key}`) .concat([`--env ${this.input.token.key}=${this.input.token.value}`]); - if (this.input.configurationFile() !== null) { - const baseName = path.basename(this.input.configurationFile().value); + const configurationFile = this.input.configurationFile(); + if (configurationFile !== null) { + const baseName = path.basename(configurationFile.value); const mountPath = path.join(this.configFileMountDir, baseName); dockerArguments.push( - `--env ${this.input.configurationFile().key}=${mountPath}`, - `--volume ${this.input.configurationFile().value}:${mountPath}` + `--env ${configurationFile.key}=${mountPath}`, + `--volume ${configurationFile.value}:${mountPath}` ); } diff --git a/tsconfig.json b/tsconfig.json index b0369556..022f92d7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,6 @@ { + "extends": "@tsconfig/node16/tsconfig.json", "compilerOptions": { - "target": "es2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, "allowSyntheticDefaultImports": true, "allowJs": true, "outDir": "dist" diff --git a/yarn.lock b/yarn.lock index 225d616f..03867606 100644 --- a/yarn.lock +++ b/yarn.lock @@ -726,7 +726,7 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== -"@tsconfig/node16@^1.0.2": +"@tsconfig/node16@1.0.3", "@tsconfig/node16@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==