Built-in Functions
GitHub
github.graphql
Executes an HTTP request against the GitHub GraphQL API and returns the status code and response body.
Example
query := ` query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { name } }`
vars := { "owner": "reposaur", "name": "reposaur",}
response := github.graphql(query, vars)
response.status == 200response.body.data.repository.name == "reposaur"
github.request
Executes an HTTP request against the GitHub REST API and returns the status code and response body.
Usage is similar to the Octokit.js library and most documentation examples
can be translated 1-1 to github.request
.
Example
response := github.request("GET /repos/{owner}/{repo}", { "owner": "reposaur", "repo": "reposaur",})
response.status == 200response.body.name == "reposaur"