Skip to content

Commit

Permalink
fix: require git api key
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjhicks committed Oct 21, 2024
1 parent 0d3ca6f commit a7953a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/diff-generator/src/lib/file-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { access, readFile } from "fs/promises";
import { existsSync } from "fs";
import path from "path";
import { glob, globSync } from "glob";
import { githubAPIKey } from "../../github-api-key.js";

const source = "https://raw.githubusercontent.com/adobe/spectrum-tokens/";

Expand Down Expand Up @@ -91,7 +92,13 @@ async function fetchTokens(tokenName, version, location) {
version !== "latest"
? source + version.replace("@", "%40")
: source + location;
return (await fetch(`${link}/packages/tokens/${tokenName}`))
return (
await fetch(`${link}/packages/tokens/${tokenName}`, {
headers: {
Authorization: "Bearer " + githubAPIKey, // api is rate limited without a personal access token
},
})
)
.json()
.then((tokens) => {
return tokens;
Expand Down

0 comments on commit a7953a8

Please sign in to comment.