diff --git a/src/main/kotlin/net/leanix/githubagent/services/WebhookEventService.kt b/src/main/kotlin/net/leanix/githubagent/services/WebhookEventService.kt index a3a56dc..49a0c9c 100644 --- a/src/main/kotlin/net/leanix/githubagent/services/WebhookEventService.kt +++ b/src/main/kotlin/net/leanix/githubagent/services/WebhookEventService.kt @@ -51,17 +51,15 @@ class WebhookEventService( val installationToken = getInstallationToken(pushEventPayload.installation.id) - headCommit?.let { - if (pushEventPayload.ref == "refs/heads/$defaultBranch") { - handleManifestFileChanges( - defaultBranch, - headCommit, - repositoryFullName, - owner, - repositoryName, - installationToken - ) - } + if (headCommit != null && pushEventPayload.ref == "refs/heads/$defaultBranch") { + handleManifestFileChanges( + defaultBranch, + headCommit, + repositoryFullName, + owner, + repositoryName, + installationToken + ) } }