Published
Edited
Jan 27, 2022
1 fork
8 stars
Insert cell
Insert cell
gistID = '56517cc4dd805ad490f32012b518726f'
Insert cell
MyGists = fetchGithub(`/gists/${gistID}`, {})
Insert cell
MyGists.files
Insert cell
// read text file. If it's empty then the GISTS might be truncated
MyGists.files[GIST_FILENAME].content
Insert cell
MyGists.files[GIST_FILENAME].truncated
Insert cell
MyGists.files[GIST_FILENAME].raw_url
Insert cell
JSON.parse(MyGists.files[GIST_FILENAME].content)
Insert cell
Insert cell
writeGist = fetchGithub(
`/gists/${gistID}`, // path
{}, // prams
{ // options
headers:{},
// method: "PATCH",
// body: JSON.stringify({
// files: {
// [GIST_FILENAME]: {
// content: JSON.stringify(testData),
// },
// },
// }),
});
Insert cell
GIST_FILENAME = 'testData'
Insert cell
testData = ([
{colour: "red", value: "#f00"},
{colour: "green", value: "#0f0"},
{colour: "blue", value: "#00f"},
{colour: "cyan", value: "#0ff"},
{colour: "magenta", value: "#f0f"},
{colour: "yellow", value: "#ff0"},
{colour: "black", value: "#000"}
])
Insert cell
// For a notebook to access Secrets, it must statically reference one; this cell grants Secret access to the notebook from which we import the GitHub API helpers. `undefined &&` prevents the Secret from appearing in plaintext in the Inspector.
undefined && Secret("GITHUB_ACCESS_TOKEN")
Insert cell
rateLimitSummary
Insert cell
import {fetchGithub, hasApiKey, rateLimitSummary} from "@observablehq/github-actions-workflows-api"
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more