Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcnellis committed Oct 5, 2024
1 parent 819a8fd commit 24f925e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/apphosting/githubConnections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ export async function getOrCreateGithubConnection(
const connection = await devConnect.getConnection(projectId, location, createConnectionId);
utils.logBullet(`Reusing existing connection ${createConnectionId}`);
return connection;
} catch (e) {
// Expected, the connection doesn't exist.
} catch (err: unknown) {
// A 404 is expected if the connection doesn't exist. Otherwise, continue to throw the err.
if ((err as any).status !== 404) {

Check warning on line 110 in src/apphosting/githubConnections.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .status on an `any` value

Check warning on line 110 in src/apphosting/githubConnections.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
throw err;
}
}
}

Expand Down Expand Up @@ -138,7 +141,7 @@ export async function getOrCreateGithubConnection(
if (connectionMatchingInstallation) {
const { id: matchingConnectionId } = parseConnectionName(connectionMatchingInstallation.name)!;

Check warning on line 142 in src/apphosting/githubConnections.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Forbidden non-null assertion

if (!createConnectionId || matchingConnectionId === createConnectionId) {
if (!createConnectionId) {
utils.logBullet(`Reusing matching connection ${matchingConnectionId}`);
return connectionMatchingInstallation;
}
Expand Down

0 comments on commit 24f925e

Please sign in to comment.