docs icon indicating copy to clipboard operation
docs copied to clipboard

Document base64 secret decoding warts on windows powershell

Open robinp opened this issue 2 years ago • 3 comments

Code of Conduct

What article on docs.github.com is affected?

https://github.com/github/docs/blob/main/content/actions/security-guides/encrypted-secrets.md

What part(s) of the article would you like to see updated?

At the very end of that doc, a linux/bash example is shown on how to base64-decode a secret.

But trying to use that as-is on powershell utterly fails for 2 reasons (probably newlines, and default UTF-16 output). I wrote those points up in https://stackoverflow.com/a/74344321/180258 for reference.

I would suggest at minimum to call attention to the issues, but even more: either give a specific working powershell example, or just suggest that bash should be used to decode base64 to binary under windows.

Hope will save some hours for other people too.

Thank you!

Additional information

No response

robinp avatar Nov 07 '22 09:11 robinp

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar Nov 07 '22 09:11 welcome[bot]

@robinp Thanks so much for opening an issue! I'll triage this for the team to take a look :eyes:

cmwilson21 avatar Nov 07 '22 15:11 cmwilson21

Thanks so much for letting us know about this, @robinp!

I've reproduced needing the -i flag (workflow run here), but my workflow did have matching hashes for the input and output files using shasum (for a simple README file that was encoded). 🤔

I think your recommendation of adding a note to the last step in the procedure to recommend using a bash shell on Windows runners is a good one.

Something like:

Note: Using another shell might require different commands for decoding the secret to a file. On Windows runners, we recommend using a bash shell with shell: bash to use the commands in the run step above.

Yourself (or anyone else) can feel free to open a PR 🙇‍♂️

lucascosti avatar Dec 05 '22 06:12 lucascosti