Skip to content

Commit

Permalink
chore: have fern-bot manage repo names as case-insensitive (#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo authored Jun 17, 2024
1 parent 2af74ec commit e99f3f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion servers/fern-bot/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# This is crazy, but it looks like you need to explicitly set the email and name of the app to commit as it.
GITHUB_APP_ID="FILL ME IN"
# Login name and ID can be retrieved from the below URL (substitute the bot name for prod):
# https://api.github.com/users/development-fern-bot%5Bbot%5D
GITHUB_APP_LOGIN_NAME="FILL ME IN"
GITHUB_APP_LOGIN_ID="FILL ME IN"
GITHUB_APP_ID="FILL ME IN"
GITHUB_APP_PRIVATE_KEY="FILL ME IN"
GITHUB_APP_CLIENT_ID="FILL ME IN"
GITHUB_APP_CLIENT_SECRET="FILL ME IN"
Expand Down
3 changes: 2 additions & 1 deletion servers/fern-bot/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ jspm_packages
.esbuild

# local env files
.env.local
.env.local
.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export async function updateOpenApiSpecsInternal(env: Env): Promise<void> {
console.log("REPO_TO_RUN_ON has been specified, only running on:", env.REPO_TO_RUN_ON);
}
await app.eachRepository(async (installation) => {
if (env.REPO_TO_RUN_ON !== undefined && installation.repository.full_name !== env.REPO_TO_RUN_ON) {
// Github repo and org names are case insentitive, so we should compare them as both lowercase
if (
env.REPO_TO_RUN_ON !== undefined &&
installation.repository.full_name.toLowerCase() !== env.REPO_TO_RUN_ON.toLowerCase()
) {
return;
} else if (env.REPO_TO_RUN_ON !== undefined) {
console.log("REPO_TO_RUN_ON has been found, running logic.");
Expand Down

0 comments on commit e99f3f6

Please sign in to comment.