aRustyDev / aRustyDev/helm-charts

test: Manual config validator doesn't check branch name regex pattern

Open
#112 0 comments 0 reactions 1 assignee Claimed by @aRustyDev View on GitHub
bug
Dominant language
Go Template
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

Test 22 in `test-schema-validation.bats` fails because the manual config validator (`_validate_config_manual`) doesn't validate the branch name pattern regex.

## Expected Behavior

Config with invalid branch name (e.g., `InvalidName` instead of `$chart` or `lowercase`) should be rejected.

## Actual Behavior

Config is accepted when no JSON Schema validator (ajv, check-jsonschema) is available.

## Impact

Low - JSON Schema validation catches this in CI where validators are installed.

## Files

- `.github/actions/atomize/lib/atomize.sh` - `_validate_config_manual` function
- `.github/tests/config/test-schema-validation.bats` - Test 22

## Suggested Fix

Add regex validation for branch name pattern in `_validate_config_manual`:
```bash
if [[ \! "$name" =~ ^(\$[a-z_]+|[a-z][a-z0-9_-]*)$ ]]; then
echo "ERROR: Invalid branch name pattern" >&2
return 1
fi
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.