Open garyp opened 2 years ago
Thanks for the detailed bug report 👍 . Error handling in bash script is always fun...
I'd be down to rewrite this logic in Kotlin, either by using a Kotlin-compatible base Docker image or (faster) by compiling a small linux Kotlin native binary. @romainbsl any thoughts?
I was passing an incorrect value for the
staging_repository_id
argument when running thecreate-nexus-staging-repo
action. However, instead of failing, the job exited successfully. Downstream jobs saw the value ofneeds.create-staging-repository.outputs.repository_id
as "null". You can see an example run at https://github.com/streem/pbandk/runs/4029266895?check_suite_focus=true.If I run the
curl
command from https://github.com/nexus-actions/create-nexus-staging-repo/blob/main/entrypoint.sh manually, I see that the output is in fact "null" rather than empty string. Which means the error handling inif [ -z "$stagingRepositoryId" ]; then
will never run.On a related note, it'd be helpful if the script printed the value of
$jsonOutput
to the log when$stagingRepositoryId
is empty or "null". That would've helped me identify the problem much quicker (the JSON output was{"errors":[{"id":"*","msg":"Cannot create Staging Repository, profile with id 'pro.streem' does not exist."}]}
in my case).