mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-04 23:02:12 +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 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);
|
const githubPat = getGitHubPatFromConfig(config.configurable, encryptionKey);
|
||||||
if (githubPat && !isProd) {
|
if (githubPat && !isProd) {
|
||||||
// check for PAT-only mode
|
// check for PAT-only mode
|
||||||
return {
|
return {
|
||||||
githubAccessToken: githubPat,
|
githubAccessToken: githubPat,
|
||||||
githubInstallationToken: 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 encryptedGitHubToken = config.configurable[GITHUB_TOKEN_COOKIE];
|
||||||
const encryptedInstallationToken =
|
const encryptedInstallationToken =
|
||||||
config.configurable[GITHUB_INSTALLATION_TOKEN_COOKIE];
|
config.configurable[GITHUB_INSTALLATION_TOKEN_COOKIE];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue