sliteteam / github-action-git-crypt-unlock

Github Action to unlock git-crypt secrets
MIT License
47 stars 23 forks source link

Handle Base64 strings that include new lines #4

Closed alyssaruth closed 4 years ago

alyssaruth commented 4 years ago

The current bash script in entrypoint.sh doesn't cope with Base64 strings including new line characters. Unfortunately, these are often included by default when you pipe to base64.

Supplying a string with new lines causes this action to fail with base64: invalid input. I can replicate the problem locally with the following two lines:

$ export GIT_CRYPT_KEY=$(cat ./original.key | base64)
$ echo $GIT_CRYPT_KEY | base64 --decode > ./copy.key
base64: invalid input

It looks like a simple fix - if we quote the environment variable properly then decoding works correctly. I'll raise a PR.

ArnaudRinquin commented 4 years ago

@alexburlton-sonocent This was fixed and published in 1.1.0. Sorry it took time, I missed all these PRs and issues.