From 7727b268e1b026d4006340141f2a00054fdc57c7 Mon Sep 17 00:00:00 2001 From: El-Fitz <8971906+El-Fitz@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:59:01 +0200 Subject: [PATCH] fix(action): properly map PRIVATE_KEYS_REFRESH_INTERVAL_IN_DAYS env parameter from string to int --- package.json | 2 +- src/bin/provision-private-keys.mts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ffa68ef..2cb804b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@csbnlu/jawks-private-keys-provisioner", - "version": "0.0.16", + "version": "0.0.17", "devDependencies": { "@types/aws-lambda": "^8.10.143", "@types/luxon": "^3.4.2", diff --git a/src/bin/provision-private-keys.mts b/src/bin/provision-private-keys.mts index 87a567b..41c041d 100644 --- a/src/bin/provision-private-keys.mts +++ b/src/bin/provision-private-keys.mts @@ -41,7 +41,12 @@ const environmentConfigSchema = z.object({ if (value === undefined) { return undefined; } - return parseInt(value); + const parsedValue = parseInt(value); + if (isNaN(parsedValue)) { + console.error("Invalid privateKeysRefreshIntervalInDays"); + return undefined; + } + return parsedValue; }), });