Skip to content

Commit

Permalink
Exit early from space_content_updated if not configured (#356)
Browse files Browse the repository at this point in the history
* Exit early from space_content_updated if not configured

* Changeset
  • Loading branch information
taranvohra authored Jan 15, 2024
1 parent fcadc5f commit 84c0202
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/cold-carpets-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@gitbook/integration-github': patch
'@gitbook/integration-gitlab': patch
---

Exit early from space_content_updated if not configured
7 changes: 6 additions & 1 deletion integrations/github/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,12 @@ const handleSpaceContentUpdated: EventCallback<

const spaceInstallation = context.environment.spaceInstallation;
if (!spaceInstallation) {
logger.debug(`missing space installation, skipping`);
logger.debug(`missing space installation for ${event.spaceId}, skipping`);
return;
}

if (!spaceInstallation.configuration.key) {
logger.debug(`space ${event.spaceId} is not configured, skipping`);
return;
}

Expand Down
7 changes: 6 additions & 1 deletion integrations/gitlab/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ const handleSpaceContentUpdated: EventCallback<

const spaceInstallation = context.environment.spaceInstallation;
if (!spaceInstallation) {
logger.debug(`missing space installation, skipping`);
logger.debug(`missing space installation for ${event.spaceId}, skipping`);
return;
}

if (!spaceInstallation.configuration.key) {
logger.debug(`space ${event.spaceId} is not configured, skipping`);
return;
}

Expand Down

0 comments on commit 84c0202

Please sign in to comment.