Update blog example env name (#5877)

This commit is contained in:
Bjorn Lu 2023-01-17 23:12:26 +08:00 committed by GitHub
parent 1ca81c16b8
commit 2000f5fb1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -17,11 +17,9 @@ type Commit = {
async function getCommits(url: string) {
try {
const token = import.meta.env.SNOWPACK_PUBLIC_GITHUB_TOKEN ?? 'hello';
const token = import.meta.env.GITHUB_TOKEN ?? 'hello';
if (!token) {
throw new Error(
'Cannot find "SNOWPACK_PUBLIC_GITHUB_TOKEN" used for escaping rate-limiting.'
);
throw new Error('Cannot find "GITHUB_TOKEN" used for escaping rate-limiting.');
}
const auth = `Basic ${Buffer.from(token, 'binary').toString('base64')}`;

View file

@ -1 +1,9 @@
/// <reference types="astro/client" />
interface ImportMetaEnv {
readonly GITHUB_TOKEN: string | undefined;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}