1 Star 0 Fork 2

k8s-devops/DevOps-Bash-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
github_get_user_ssh_public_key_api.sh 681 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
#
# Author: Hari Sekhon
# Date: 2019-09-18
#
# https://github.com/harisekhon/devops-bash-tools
#
# License: see accompanying LICENSE file
#
# https://www.linkedin.com/in/harisekhon
#
# Fetches the GitHub user's public SSH key from the GitHub API
#
# Uses $GITHUB_USER or $USER as the expected GitHub user
set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
if [[ "$USER" =~ hari|sekhon ]]; then
GITHUB_USER="${GITHUB_USER:-harisekhon}"
else
GITHUB_USER="${GITHUB_USER:-$USER}"
fi
echo "# Fetching SSH Public Key(s) from GitHub for account: $GITHUB_USER" >&2
echo "#" >&2
curl -sS "https://api.github.com/users/$GITHUB_USER/keys" |
jq -r '.[].key'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/k8s-devops/DevOps-Bash-tools.git
git@gitee.com:k8s-devops/DevOps-Bash-tools.git
k8s-devops
DevOps-Bash-tools
DevOps-Bash-tools
master

搜索帮助