code_corps v0.0.1 CodeCorps.GitHub.Event.InstallationRepositories View Source
In charge of handling a GitHub Webhook payload for the InstallationRepositories event type.
https://developer.github.com/v3/activity/events/types/#installationrepositoriesevent
Link to this section Summary
Functions
Handles an “InstallationRepositories” GitHub Webhook event. The event could be of subtype “added” or “removed” and is handled differently based on that
Link to this section Functions
Link to this function
handle(payload)
View Source
handle(map()) :: CodeCorps.GitHub.Sync.installation_repositories_event_outcome() | {:error, :unexpected_payload}
Handles an “InstallationRepositories” GitHub Webhook event. The event could be of subtype “added” or “removed” and is handled differently based on that.
the process of handling the “added” subtype is as follows
- try to match with
CodeCorps.GithubAppInstallationrecord - sync affected
CodeCorps.GithubReporecords (update, create)
- try to match with
the process of handling the “removed” subtype is as follows
- try to match with a
CodeCorps.GithubAppInstallationrecord delete affected
CodeCorps.GithubReporecords, respecting the rules- if the GitHub payload for a repo is not matched with a record in our database, just skip deleting it
- try to match with a