Skip to content

Instantly share code, notes, and snippets.

@kylecorry31
Last active August 19, 2023 11:40
Show Gist options
  • Save kylecorry31/47ec9ef466b72b655f6927a7c223b9c3 to your computer and use it in GitHub Desktop.
Save kylecorry31/47ec9ef466b72b655f6927a7c223b9c3 to your computer and use it in GitHub Desktop.
Encode a file to base64 for use in github secrets
echo ${ENCODED_FILE_AS_ENVIRONMENT_VARIABLE} | base64 -d > decoded.txt
cat <filename> | base64 | tr -d '\n'
@kylecorry31
Copy link
Author

For use with github actions:

  1. Enter the base64 encoded file as a secret
  2. Use the secret as an environment variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment