New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[terraform/upgrade-modules] Update all module sources to latest version #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - however, this required json2hcl
and jq
.. should there be warnings emitted if they are not present maybe at the top of the upgrade_terraform_modules.sh for now?
@sarkis yea good point |
bin/upgrade_terraform_modules.sh
Outdated
function github_latest_release() { | ||
local org=$1 | ||
local repo=$2 | ||
local ref=$(curl -sSL https://api.github.com/repos/$org/$repo/releases/latest | jq .tag_name -r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub rate-limits unauthenticated calls to their api endpoint by source IP.
https://developer.github.com/changes/2012-10-14-rate-limit-changes/
I've found this kind of query works fine locally, but fails sporadically from CI. The typical workaround seems to be to create a bot user with zero access to anything, generate an access token, and then use basic auth in the curl command....
curl -sSL https://api.github.com/repos/$org/$repo/releases/latest?access_token=<the access token>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I was just being lazy =)
I've added support for the tokens. Decided to use a header since that is less likely to show up in access logs. https://gist.github.com/caspyin/2288960#oauth
Very entertaining usage of |
what
why
demo
references