Fix tc-lint glob handling for charts without ci/*values.yaml (#45013)
Lint runs were emitting `ls: cannot access '.../ci/*values.yaml'` for charts that do not define CI override files (e.g. `charts/stable/friendica`). The issue came from using `ls` as a glob existence check in `tc-lint.sh`. - **Root cause** - `helm_lint()` used `ls $chart_path/ci/*values.yaml` inside a conditional; when the glob had no matches, `ls` printed an error. - **Change** - Replaced the `ls`-based check with a silent glob match check using `compgen -G`. - Scope is limited to `.github/scripts/tc-lint.sh` and preserves existing lint decision logic. - **Behavioral impact** - Charts without `ci/*values.yaml` no longer produce noisy shell errors during lint. - Existing lint pass/fail behavior remains unchanged. ```bash # before if [[ ! $(ls $chart_path/ci/*values.yaml) ]]; then # after if ! compgen -G "$chart_path/ci/*values.yaml" >/dev/null; then ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PrivatePuffin <7613738+PrivatePuffin@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@ function helm_lint() {
|
||||
|
||||
# TODO: If there are ci/*values.yaml files, lint those
|
||||
# and skip linting the top-level values.yaml.
|
||||
if [[ ! $(ls $chart_path/ci/*values.yaml) ]]; then
|
||||
if ! compgen -G "$chart_path/ci/*values.yaml" >/dev/null; then
|
||||
if echo "$helm_lint_output" | grep -q "Fail:"; then
|
||||
helm_lint_exit_code=1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user