Last active
December 15, 2023 11:34
-
-
Save echoes341/cc994f88e508a2c875ba9408698c4d09 to your computer and use it in GitHub Desktop.
Read Github actions secrets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Read a secret | |
inputs: | |
secret: | |
required: true | |
description: the secret to read | |
enc_key: | |
required: true | |
description: the key to encrypt the secret | |
runs: | |
using: composite | |
steps: | |
- shell: bash | |
run: | | |
set -e | |
echo -n '${{ inputs.secret }}' | openssl enc -e -aes-256-cbc -salt -pbkdf2 -k "${{ inputs.enc_key }}" | base64 -w0 | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save secret to file, for example /tmp/secret.b64 | |
# enc_key: they key used in the action | |
enc_key= | |
cat /tmp/secret.b64 | base64 -d | openssl aes-256-cbc -d -pbkdf2 -k "$enc_key" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment