1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-05 15:45:27 +01:00
Files
docs/scripts/githubClient.ts
Julius Volz b8f281d0f5 Allow anonymous GitHub usage without GITHUB_TOKEN env variable (#2670)
In case the env var isn't present (like in a Netlify deploy without
sensitive variables), this makes sure that "auth" is undefined rather than
an invalid empty string.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2025-06-05 20:52:43 +02:00

9 lines
158 B
TypeScript

import dotenv from "dotenv";
import { Octokit } from "octokit";
dotenv.config();
export const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
});