mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 10:23:14 +00:00
fix: dont require an installation ID in eval mode (#721)
This commit is contained in:
parent
39a8ee67ee
commit
daa042add2
1 changed files with 9 additions and 8 deletions
|
|
@ -24,23 +24,24 @@ export function getGitHubTokensFromConfig(config: GraphConfig): {
|
|||
|
||||
const isProd = process.env.NODE_ENV === "production";
|
||||
|
||||
const installationId = config.configurable[GITHUB_INSTALLATION_ID];
|
||||
if (!installationId) {
|
||||
throw new Error(
|
||||
`Missing required ${GITHUB_INSTALLATION_ID} in configuration.`,
|
||||
);
|
||||
}
|
||||
|
||||
const githubPat = getGitHubPatFromConfig(config.configurable, encryptionKey);
|
||||
if (githubPat && !isProd) {
|
||||
// check for PAT-only mode
|
||||
return {
|
||||
githubAccessToken: githubPat,
|
||||
githubInstallationToken: githubPat,
|
||||
installationId,
|
||||
// installationId is not required in PAT-only mode
|
||||
installationId: config.configurable[GITHUB_INSTALLATION_ID] ?? "",
|
||||
};
|
||||
}
|
||||
|
||||
const installationId = config.configurable[GITHUB_INSTALLATION_ID];
|
||||
if (!installationId) {
|
||||
throw new Error(
|
||||
`Missing required ${GITHUB_INSTALLATION_ID} in configuration.`,
|
||||
);
|
||||
}
|
||||
|
||||
const encryptedGitHubToken = config.configurable[GITHUB_TOKEN_COOKIE];
|
||||
const encryptedInstallationToken =
|
||||
config.configurable[GITHUB_INSTALLATION_TOKEN_COOKIE];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue