Created
February 10, 2023 02:53
-
-
Save joshpollara/423cc7455571b3b56798253d9653f2b7 to your computer and use it in GitHub Desktop.
calculate github thumbprint
This file contains 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
#!/usr/bin/env bash | |
HOST=$(curl -s https://vstoken.actions.githubusercontent.com/.well-known/openid-configuration | jq -r '.jwks_uri | split("/")[2]') | |
echo | openssl s_client -servername "$HOST" -showcerts -connect "$HOST:443" 2> /dev/null \ | |
| sed -n -e '/BEGIN/h' -e '/BEGIN/,/END/H' -e '$x' -e '$p' | tail +2 \ | |
| openssl x509 -fingerprint -noout \ | |
| sed -e "s/.*=//" -e "s/://g" \ | |
| tr "ABCDEF" "abcdef"$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment