Skip to content

Validate min_mask_length instead of silently disabling masking - #330

Closed
kkarrenn wants to merge 1 commit into
mainfrom
test/pr-329
Closed

kkarrenn wants to merge 1 commit into
mainfrom
test/pr-329

Conversation

@kkarrenn

@kkarrenn kkarrenn commented Sep 2, 2026

Copy link
Copy Markdown

parseInt(getInput('min_mask_length')) returns NaN for an empty or non-numeric value, and every line.length >= NaN comparison is false, so the masking loop makes zero setSecret() calls while the secret is still written to GITHUB_OUTPUT. No error or warning is raised, so a run with no masking looks identical to a run with masking.

The empty value is reachable without a typo: the runner substitutes an action.yml default only when the input key is absent, so a pass-through such as min_mask_length: ${{ inputs.min_mask_length }} with an unset caller input arrives as the empty string.

parseMinMaskLength() mirrors parseBoolean() from actions-utils. An empty value returns the declared default of 4, and a value that is not a non-negative integer raises an error rather than being ignored, which matches the existing handling of an invalid encoding.

parseInt(getInput('min_mask_length')) returns NaN for an empty or
non-numeric value, and every `line.length >= NaN` comparison is false, so
the masking loop makes zero setSecret() calls while the secret is still
written to GITHUB_OUTPUT. No error or warning is raised, so a run with no
masking looks identical to a run with masking.

The empty value is reachable without a typo: the runner substitutes an
action.yml default only when the input key is absent, so a pass-through
such as `min_mask_length: ${{ inputs.min_mask_length }}` with an unset
caller input arrives as the empty string.

parseMinMaskLength() mirrors parseBoolean() from actions-utils. An empty
value returns the declared default of 4, and a value that is not a
non-negative integer raises an error rather than being ignored, which
matches the existing handling of an invalid encoding.
@kkarrenn
kkarrenn requested a review from a team as a code owner September 2, 2026 14:31
@kkarrenn
kkarrenn requested review from ChrisGe4 and haroonc September 2, 2026 14:31
@kkarrenn kkarrenn closed this Sep 2, 2026
@kkarrenn
kkarrenn deleted the test/pr-329 branch September 2, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants