Created
December 8, 2022 06:17
-
-
Save philip-gai/842a2e8c84358007aa9d047dba416c26 to your computer and use it in GitHub Desktop.
Encrypt a secret using a GitHub user's public SSH Key (WIP)
This file contains hidden or 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
#!/bin/bash | |
# The first argument is the username | |
username=$1 | |
if [ -z "$username" ]; then | |
echo "Please provide a username" | |
exit 1 | |
fi | |
# The second argument is the secret | |
secret=$2 | |
if [ -z "$secret" ]; then | |
echo "Please provide a secret" | |
exit 1 | |
fi | |
# Get the user's public GitHub SSH key | |
echo "Getting the user's public GitHub SSH keys" | |
curl -i https://api.github.com/users/$username/keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment