From aacf67799e6fb126957515fa10c47bf2de639a78 Mon Sep 17 00:00:00 2001 From: Armando Belardo <11140328+armandobelardo@users.noreply.github.com> Date: Tue, 7 May 2024 17:25:30 -0400 Subject: [PATCH] fix: remove botched newlines from github actions secret for fern-bot (#821) --- servers/fern-bot/package.json | 4 +++- .../src/functions/oas-cron/actions/updateOpenApiSpecs.ts | 5 +++-- servers/fern-bot/src/libs/cohere.ts | 2 +- servers/fern-bot/src/libs/env.ts | 2 +- servers/fern-bot/src/libs/handler-resolver.ts | 3 --- servers/fern-bot/src/libs/handler-wrapper.ts | 1 + 6 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 servers/fern-bot/src/libs/handler-resolver.ts diff --git a/servers/fern-bot/package.json b/servers/fern-bot/package.json index 1552fd272f..91f6704d0c 100644 --- a/servers/fern-bot/package.json +++ b/servers/fern-bot/package.json @@ -8,7 +8,9 @@ "lint": "eslint --max-warnings 0 src --ext .ts", "format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"", "lint:fix": "pnpm lint --fix", - "proxy": "smee -u https://smee.io/3DXoSvCO2NH87w8e" + "proxy": "smee -u https://smee.io/3DXoSvCO2NH87w8e", + "lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore", + "lint:eslint:fix": "pnpm lint:eslint --fix" }, "engines": { "node": ">=14.15.0" diff --git a/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts b/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts index d3344ec053..5c5e8c7dcf 100644 --- a/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts +++ b/servers/fern-bot/src/functions/oas-cron/actions/updateOpenApiSpecs.ts @@ -26,6 +26,7 @@ async function updateOpenApiSpecInternal(octokit: Octokit, repository: Repositor await mkdir(fullRepoPath, { recursive: true }); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any const installationToken = ((await octokit.auth({ type: "installation" })) as any).token; const git = simpleGit(fullRepoPath); @@ -35,7 +36,7 @@ async function updateOpenApiSpecInternal(octokit: Octokit, repository: Repositor try { // If you can fetch the branch, checkout the branch await git.fetch(branchRemoteName, OPENAPI_UPDATE_BRANCH); - console.log(`Branch exists, checking out`); + console.log("Branch exists, checking out"); await git.checkout(OPENAPI_UPDATE_BRANCH); // Merge the default branch into this branch to update it // prefer the default branch changes @@ -45,7 +46,7 @@ async function updateOpenApiSpecInternal(octokit: Octokit, repository: Repositor // to the same branch that are not OpenAPI related, that we'd lose if we deleted and reupdated the spec. await git.merge(["-X", "theirs", originDefaultBranch]); } catch (e) { - console.log(`Branch does not exist, create and checkout`); + console.log("Branch does not exist, create and checkout"); await git.checkoutBranch(OPENAPI_UPDATE_BRANCH, branchRemoteName); } diff --git a/servers/fern-bot/src/libs/cohere.ts b/servers/fern-bot/src/libs/cohere.ts index 4ed5aa4258..e25e3ed98d 100644 --- a/servers/fern-bot/src/libs/cohere.ts +++ b/servers/fern-bot/src/libs/cohere.ts @@ -197,7 +197,7 @@ export async function generateChangelog(diff: string): Promise { } -} +} - \ No newline at end of file + \\ No newline at end of file \`\`\` Changelog: ## Summary diff --git a/servers/fern-bot/src/libs/env.ts b/servers/fern-bot/src/libs/env.ts index a236b4408b..8ce601f904 100644 --- a/servers/fern-bot/src/libs/env.ts +++ b/servers/fern-bot/src/libs/env.ts @@ -14,7 +14,7 @@ export function evaluateEnv(): Env { const repoToRunOn = process?.env.REPO_TO_RUN_ON; return { GITHUB_APP_ID: process?.env.GITHUB_APP_ID, - GITHUB_APP_PRIVATE_KEY: process?.env.GITHUB_APP_PRIVATE_KEY, + GITHUB_APP_PRIVATE_KEY: process?.env.GITHUB_APP_PRIVATE_KEY?.replaceAll("\\n", "\n"), GITHUB_APP_CLIENT_ID: process?.env.GITHUB_APP_CLIENT_ID, GITHUB_APP_CLIENT_SECRET: process?.env.GITHUB_APP_CLIENT_SECRET, GITHUB_APP_WEBHOOK_SECRET: process?.env.GITHUB_APP_WEBHOOK_SECRET, diff --git a/servers/fern-bot/src/libs/handler-resolver.ts b/servers/fern-bot/src/libs/handler-resolver.ts deleted file mode 100644 index 83e45e0f6e..0000000000 --- a/servers/fern-bot/src/libs/handler-resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const handlerPath = (context: string) => { - return `${context.split(process.cwd())[1].substring(1).replace(/\\/g, "/")}`; -}; diff --git a/servers/fern-bot/src/libs/handler-wrapper.ts b/servers/fern-bot/src/libs/handler-wrapper.ts index 94b4f1ac1e..ee76cd6a33 100644 --- a/servers/fern-bot/src/libs/handler-wrapper.ts +++ b/servers/fern-bot/src/libs/handler-wrapper.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import type { APIGatewayProxyEvent, APIGatewayProxyResult, Context } from "aws-lambda"; export const handlerWrapper =