keel
keel copied to clipboard
Fix github webhook payload detection logic
The correct value for "package_type" seems to be "CONTAINER" instead of "docker"
I'm not sure how the original author came up with the value "docker", perhaps that was deprecated/obsoleted by GitHub sometime ago? The documentation at https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#registry_package doesn't mention anything about potential values.
This was a quick-fix to make GitHub webhook works again but I think if there's time, we should change the detection code to be a bit more robust w/r to GitHub changes (i.e. checks on a well-documented key instead)
Also it looks like you need the "Repositories" permission on the webhook too, otherwise it seems the repository key will not be sent on the webhook payload.
Also change event type s/package_v2/package/ and this will fix #713
Additional references:
- https://github.com/octokit/webhooks/pull/747
- https://github.com/google/go-github/issues/2033
- https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#package
Still not merged ?