|
Originally I used something akin to
printf "mysecret" >secret.txt
to avoid adding a newline to the end of the file, but that doesn't work
for more advanced usecases, such as when using agenix to edit an
encryped secret (Vim really likes to add final newlines).
Since the addition/lack of a newline affects the resulting hash, this is
pretty important.
I opted to just trim the end of the file, since that's probably what the
user wants and isn't likely to break anything. I don't think it's even
possible to submit a secret containing final whitespace through GitHub's
web interface anyways.
|