Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update Github actions to use the new fern-bot functions #1078

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/invoke-fern-bot-update-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: 🚀 serverless deploy
run: |
pnpm --filter "@fern-platform/fern-bot" install
pnpm --filter "@fern-platform/fern-bot" invoke local --function updateOpenApiSpec --stage development
pnpm --filter "@fern-platform/fern-bot" invoke local --function updateOpenApiSpecs --stage development

invoke_prod:
if: ${{ github.event.inputs.environment == 'production' }}
Expand All @@ -60,4 +60,4 @@ jobs:
- name: 🚀 serverless deploy
run: |
pnpm --filter "@fern-platform/fern-bot" install
pnpm --filter "@fern-platform/fern-bot" invoke local --function updateOpenApiSpec --stage production
pnpm --filter "@fern-platform/fern-bot" invoke local --function updateOpenApiSpecs --stage production
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { updateSpecInternal } from "../shared/updateSpecInternal";
export async function updateOpenApiSpecsInternal(env: Env): Promise<void> {
const app: App = setupGithubApp(env);

let foundRepo = false;
if (env.REPO_TO_RUN_ON !== undefined) {
console.log("REPO_TO_RUN_ON has been specified, only running on:", env.REPO_TO_RUN_ON);
}
Expand All @@ -18,6 +19,7 @@ export async function updateOpenApiSpecsInternal(env: Env): Promise<void> {
return;
} else if (env.REPO_TO_RUN_ON !== undefined) {
console.log("REPO_TO_RUN_ON has been found, running logic.");
foundRepo = true;
}

await updateSpecInternal(
Expand All @@ -33,4 +35,8 @@ export async function updateOpenApiSpecsInternal(env: Env): Promise<void> {
env.GITHUB_APP_LOGIN_ID,
);
});

if (!foundRepo && env.REPO_TO_RUN_ON !== undefined) {
console.log("REPO_TO_RUN_ON has been specified, but no matching repos were found, so no action was taken.");
}
}
Loading