Skip to content

Commit

Permalink
React to webhook deletions as well
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
  • Loading branch information
JAORMX committed Apr 11, 2024
1 parent 01c471d commit 5256cc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/controlplane/handlers_githubwebhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,5 +919,10 @@ func parseRepoID(repoID any) (int64, error) {

func shouldIssueDeletionEvent(m *message.Message) bool {
return m.Metadata.Get(entities.ActionEventKey) == WebhookActionEventDeleted &&
m.Metadata.Get(events.GithubWebhookEventTypeKey) == "repository"
deletionOfRelevantType(m)
}

func deletionOfRelevantType(m *message.Message) bool {
return m.Metadata.Get(events.GithubWebhookEventTypeKey) == "repository" ||
m.Metadata.Get(events.GithubWebhookEventTypeKey) == "meta"
}

0 comments on commit 5256cc1

Please sign in to comment.