Skip to content

Instantly share code, notes, and snippets.

@philip-gai
Created December 8, 2022 06:17
Show Gist options
  • Save philip-gai/842a2e8c84358007aa9d047dba416c26 to your computer and use it in GitHub Desktop.
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)
#!/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