Closed as not planned
Description
Description
The providers on https://symfony.com/doc/current/webhook.html are for email and notifiers (like SMS). Since every developer using Symfony has a github account and many use github for their applications, a native github provider would be useful.
Example
use Symfony\Component\RemoteEvent\Attribute\AsRemoteEventConsumer;
use Symfony\Component\RemoteEvent\Consumer\ConsumerInterface;
use Symfony\Component\RemoteEvent\Event\Github\IssueEvent;
use Symfony\Component\RemoteEvent\Event\Github\PullRequestEvent;
use Symfony\Component\RemoteEvent\RemoteEvent;
#[AsRemoteEventConsumer('github')]
class WebhookListener implements ConsumerInterface
{
public function consume(RemoteEvent $event): void
{
if ($event instanceof IssueEvent) {
$this->handleIssueEvent($event);
} elseif ($event instanceof PullRequestEvent) {
$this->handlePullRequestEvent($event);
} else {
// This is not an Github event
return;
}
}
}