-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use Github API to update the docs #2101
Use Github API to update the docs #2101
Conversation
Instead of a hard-coded version of the docs we want to realease, this uses the Github API to get the last 20 versions and publish those. This will allow any script invoking this to make sure to always have the latest version of the docs
docs/build.sh
Outdated
'v0.9.3' | ||
'v0.8.3' | ||
) | ||
IFS=$'\n' read -r -d '' -a VERSIONS_ARRAY < <(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/99designs/gqlgen/releases?per_page=20" | jq -r '.[].tag_name') |
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.
Couple of things to note:
- This limits to the last 20 versions. I think it's probably enough. We could have more, but those versions risk being very old.
- This assumes
jq
&curl
has been installed on the machine running this script. I suspect that is the case though I am not sure how render.com works - This will also change the position of
master
to being at the bottom of the list all the time. - This acts as an un-authenticated CURL request. We can actually authenticate it too with some config vars to avoid the 60/hour rate limit.
docs/build.sh
Outdated
@@ -3,25 +3,13 @@ | |||
# This was adapted from https://github.com/dgraph-io/dgraph/blob/master/wiki/scripts/build.sh | |||
# | |||
|
|||
set -e |
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.
For some reason, this would not work if I left it in. Don't think it's a huge issue
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.
-e
When this option is on, if a simple command fails for any of the reasons listed in Consequences of
Shell Errors or returns an exit status value >0, and is not part of the compound list following a
while, until, or if keyword, and is not a part of an AND or OR list, and is not a pipeline
preceded by the ! reserved word, then the shell shall immediately exit.
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.
Yes - I understand that - I'm just unsure what the error is because I don't get an output. I'll put it a commit that reinstates it. It may help clarify
This will be great. I'm going to merge this as is, but if it fails on master, then I'll look into changing it to |
* Use Github API to update the docs Instead of a hard-coded version of the docs we want to realease, this uses the Github API to get the last 20 versions and publish those. This will allow any script invoking this to make sure to always have the latest version of the docs * Reinstate set -e
* Use Github API to update the docs Instead of a hard-coded version of the docs we want to realease, this uses the Github API to get the last 20 versions and publish those. This will allow any script invoking this to make sure to always have the latest version of the docs * Reinstate set -e
Instead of a hard-coded version of the docs we want to realease, this
uses the Github API to get the last 20 versions and publish those. This
will allow any script invoking this to make sure to always have the
latest version of the docs