Skip to content

Instantly share code, notes, and snippets.

@philip-gai
Created December 8, 2022 06:17
Show Gist options
  • Select an option

  • Save philip-gai/842a2e8c84358007aa9d047dba416c26 to your computer and use it in GitHub Desktop.

Select an option

Save philip-gai/842a2e8c84358007aa9d047dba416c26 to your computer and use it in GitHub Desktop.

Revisions

  1. philip-gai created this gist Dec 8, 2022.
    20 changes: 20 additions & 0 deletions encrypt-secret.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/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