Skip to content

Commit

Permalink
fix(ssh-key): correct variable + signing for GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeijn committed Aug 11, 2024
1 parent cfdb4b2 commit 10fe44d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gen_ssh_key_and_add_to_scms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ if [ -z ${GITLAB_TOKEN+x} ] &> /dev/null; then echo "GITLAB_TOKEN not set!" && e
if [ -z ${GITHUB_TOKEN+x} ] &> /dev/null; then echo "GITHUB_TOKEN not set!" && exit 1; fi

_user_full_name="$(getent passwd | grep "^$(whoami)" | cut -d":" -f5 | cut -d"," -f1)"
_ssh_key_title="$(_user_full_name)'s computer (Auto-added by Chezmoi)"
_ssh_key_title="${_user_full_name}'s $(lshw -json| jq -r .product), serial $(lshw -json | jq -r .serial) (Auto-added by Chezmoi)"
echo "$_ssh_key_title"

echo ""
echo "==============================================================="
Expand All @@ -21,7 +22,7 @@ echo ""
ssh-keygen -t ed25519

gh ssh-key add "${HOME}/.ssh/id_ed25519.pub" --title "${_ssh_key_title}"
glab ssh-key add "${HOME}/.ssh/id_ed25519.pub" --title "${_ssh_key_title}" --type signing
gh ssh-key add "${HOME}/.ssh/id_ed25519.pub" --title "${_ssh_key_title}" --type signing
glab ssh-key add "${HOME}/.ssh/id_ed25519.pub" --title "${_ssh_key_title}"

echo "Adding gitlab.com to SSH Known Hosts..."
Expand Down

0 comments on commit 10fe44d

Please sign in to comment.