From a3de932e45c2e8ef98c5fa4191c6e92213899a7c Mon Sep 17 00:00:00 2001 From: Milan Freml Date: Tue, 25 Jun 2024 10:29:30 +0300 Subject: [PATCH] fix: threshold-pixel param default overrides threshold-rate (#147) Allows threshold-pixel value to be null as well, if not defined. That way, when specifying threshold-rate, only the threshold-rate will be applied. Otherwise threshold-rate does not have any effect, since it will always be overriden by threshold-pixel that defaults to 0. --- src/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index b40b91ae..145c5f24 100644 --- a/src/config.ts +++ b/src/config.ts @@ -9,7 +9,7 @@ export interface Config { enableAntialias: boolean; matchingThreshold: number; thresholdRate: number; - thresholdPixel: number; + thresholdPixel: number | null; targetHash: string | null; artifactName: string; branch: string; @@ -116,7 +116,7 @@ export const getConfig = (): Config => { validateImageDirPath(imageDirectoryPath); const matchingThreshold = getNumberInput('matching-threshold') ?? 0; const thresholdRate = getNumberInput('threshold-rate') ?? 0; - const thresholdPixel = getNumberInput('threshold-pixel') ?? 0; + const thresholdPixel = getNumberInput('threshold-pixel'); const retentionDays = getNumberInput('retention-days') ?? 30; validateMatchingThreshold(matchingThreshold); validateThresholdRate(thresholdRate);