"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildGithubHeaders = buildGithubHeaders;
const GITHUB_TOKEN_ENV = "GITHUB_TOKEN";
const GH_TOKEN_ENV = "GH_TOKEN";
const AUTHORIZATION_HEADER = "authorization";
function buildGithubHeaders(env) {
    const token = [env[GITHUB_TOKEN_ENV], env[GH_TOKEN_ENV]].find((candidate) => candidate !== undefined && candidate.trim() !== "");
    const headers = {
        accept: "application/vnd.github+json",
        "user-agent": "alpacaloop-github-client",
    };
    if (token !== undefined && token.trim() !== "") {
        headers[AUTHORIZATION_HEADER] = `Bearer ${token}`;
    }
    return headers;
}
