coverallsapp / orb

Coveralls CircleCI Orb
https://circleci.com/orbs/registry/orb/coveralls/coveralls
MIT License
2 stars 16 forks source link

Orb does not accept ~ for representing home #33

Closed josegonzalez closed 1 year ago

josegonzalez commented 1 year ago

In some cases, a user might set the path to the coverage file as something like ~/coveralls.lcov. In this case, the ~ is read as part of a literal filename due to the -f check quoting the file path, causing the orb to fail to upload the coverage file even though it doesn't exist.

I think a fix would be to do something like COVERALLS_COVERAGE_FILE="$(readlink -f "$COVERALLS_COVERAGE_FILE")" after checking if the variable is empty but before the existence checks. I'll file a PR with this change.

mrexox commented 1 year ago

Hey! Did you face this issue in your project? Could you please share, what value you passed and what error you saw?

josegonzalez commented 1 year ago

Yeah I did. I set The coverage_file to ~/repo/backend/lcov.info and received the following:

coveralls-linux.tar.gz: OK
Parsing args
Dry run - 0
Please specify a valid 'coverage_file' parameter. File doesn't exist. Filename: ~/repo/backend/lcov.info

Exited with code exit status 1
CircleCI received exit code 1

The file definitely exists - the upload_artifacts step works fine with that value - but because of how the quoting works, the ~ part is treated as a literal character.