Adding binary file to secrets breaks build

Hey there, I’ve been stuck with this issue for a few days and I’m out of ideas what may be going on.

I have this binary file (binary_file from now on) that I need to add to secrets so I did that through CLI:

$ drone --version
drone version 0.8.6

$ drone secret add -event push -event pull_request -event tag -event deployment -repository my_repo -name BINARY_FILE -value @binary_file_path

$ drone secret ls -repository my_repo
Events: push, pull_request, tag, deployment
Images: <any>

Then, I make us of it as follows:

    image: richyrick/flutter
        - printenv
        event: [push]
    secrets: [BINARY_FILE]

And trigger a new build. When I go look at the output, there is no ouput, it just says exit code 0.

If I remove the secrets: [BINARY_FILE] part, I do get the output of printenv command correctly.

Even more, if I go and follow the same steps with another file (i.e. a text file), I do see the secret being correctly listed in printenv.

It seems like this binary file has some particularity that is breaking things but I’m not sure what is it, maybe you guys can spot something I’m not seeing.

Thanks in advance!

I have never tried using binary files in secrets, but in this case it sounds like you may need to base64 encode your file, and you can base64 decode the variable in your build step.

Ah I see, I’ll try that out then, thanks!