🚳 Remove dependency on go-github and implement a custom approach to webhook receiving that can hopefully accommodate different webhooks, ie GitLab.
⚒ Update functions like GetSSHRemote to accommodate different hosts (right now it assumes the remote URL is a GitHub one)
🚧 Probably a few other changes to make as well related to GitHub assumptions
Implementation Ideas 🏋️
for webhooks, a constructor that can take a request body and attempt to parse it into different structs (one for each supported API). If it errors, attempt to parse into another. Return an interface:
// webhookPayload represents a generic webhook payload
type webhookPayload interface {
// GetBody returns the struct representing the hook request
GetBody()
// GetBranchName returns the webhook branch name
GetBranchName()
// GetRefHead returns the webhook ref head
GetRefHead()
// ... etc etc etc
}
Implement this interface for GitHub, GitLab, whatever
🚳 Remove dependency on
go-githuband implement a custom approach to webhook receiving that can hopefully accommodate different webhooks, ie GitLab.⚒ Update functions like
GetSSHRemoteto accommodate different hosts (right now it assumes the remote URL is a GitHub one)🚧 Probably a few other changes to make as well related to GitHub assumptions
Implementation Ideas 🏋️
for webhooks, a constructor that can take a request body and attempt to parse it into different structs (one for each supported API). If it errors, attempt to parse into another. Return an interface:
Implement this interface for GitHub, GitLab, whatever