helm / chart-testing-action

A GitHub Action to lint and test Helm charts
https://github.com/helm/chart-testing
Apache License 2.0
251 stars 71 forks source link

Provide a helpful error when the target-branch is wrongly configured #43

Closed ctron closed 2 years ago

ctron commented 4 years ago

I created a new repository, and named the master branch main. Running the lint command failed with a weird error message:

…
Digest: sha256:b7bb1e485c9a7ff67f448ebf9bb54db2cf49150b4f71a3620a87b8f85c32d2d4
Status: Downloaded newer image for quay.io/helmpack/chart-testing:v3.0.0
01ae6f5ccb65b12eb7faa050bcf39fb8526bca8866fb88eecf556e06af7ed699

Error: Error running process: exit status 128
Removing ct container...
Done!

I took me a while to figure out that the linter requires a default branch named master. I know it is possible to re-configure using:

target-branch: main

However, I think that:

davidkarlsen commented 4 years ago

+1 - ran into this myself. If you run the ct command natively it will provide more output. I believe this is because the stdout is lost in the docker run of ct and not piped out to the console, hence you are left with only the error-code.

unguiculus commented 4 years ago

That's a weird one. I can reproduce it with the GitHub action. For some reason stderr seems to get lost. However, when I run ct locally in Docker the same way the action does, I get a better error message as expected.

$ docker run --rm -ti -v $(pwd):/workdir --workdir /workdir --detach --network host --name ct quay.io/helmpack/chart-testing:v3.1.1 cat
a784466f568784ea490abe50b0294cf710ca761d988fcbfd575400928d3fde1c

$ docker exec -i ct ct lint --target-branch foo
Linting charts...
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
Error: Error linting charts: Error identifying charts to process: Error running process: exit status 128
Error linting charts: Error identifying charts to process: Error running process: exit status 128
noygal commented 4 years ago

I can replicate both @ctron and @unguiculus errors, tried to solve the issue on github actions by debugging it locally, same error as mention above.

Update: Following this comment: https://github.com/helm/chart-testing-action/issues/25#issuecomment-687795744 I've managed to solve the issue by using configuration file, you can see the solution here: https://github.com/noygal/helm-github-pages-example/tree/main/.github

jenting commented 2 years ago

+1, I encountered the same error.

cpanato commented 2 years ago

closing due inactivity and looks like there is an workaround