Last active
January 18, 2020 04:05
-
-
Save coip/2371ef653b4a57479b0cdfd76c1751c9 to your computer and use it in GitHub Desktop.
gets latest go.mod
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
#!/bin/sh | |
raw=$(curl -s -H "Authorization: token $PAT" https://api.github.com/repos/$1/$2/contents/go.mod \ | |
| grep -o "https://raw.*token=[a-zA-Z0-9]*") | |
curl -s "${raw}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
quick n dirty cli usage:
PAT=$TOKEN ./getgomod.sh $ORG $REPO
note: place a space at the start of line to prevent committing PAT to history