Skip to content

Commit

Permalink
fix: threshold-pixel param default overrides threshold-rate (#147)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kopancek authored Jun 25, 2024
1 parent 763bf67 commit a3de932
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a3de932

Please sign in to comment.