Skip to content

Update Packagist with GitHub webhooks without Service

In April this year GitHub announced that it would deprecate the GitHub Service feature, which currently is the recommended way to setup a Packagist package with GitHub. Don’t worry, you still have plenty of time… GitHub is not going to discontinue this feature till the beginning of 2019, but if you’re currently setting up GitHub with packagist, then you might want to do it already the new way.

The official Packagist documentation lacks instructions on how to setup automatic updating of Packagist using GitHub WebHooks. Here’s how you do it:

1. Go to your GitHub repository and select  Settings -> WebHooks

2. As the PayLoad URL type in

Replace XYZ with your API Token, see your Packagist profile for your API token.

3. Content-Type needs to be application/json

4. Insert the following into secret, this is the actual JSON payload:

Don’t forget to replace PACKAGIST_PACKAGE_URL  with the URL of your package e.g. https://packagist.org/packages/user/some-package

5.Now you can select which events should trigger the actual push to Packagist.

6. You’re done, this is how it should look like:

Published inUncategorized

6 Comments

  1. Anonymous

    Thanks. Couldn’t find anything on how to setup github webhooks with packagist.

  2. Francisco

    Thanks!!! It helped me!!

  3. Ako

    Thank you very much. I didn’t find anything about how to configure github webhooks with Packagists, your post helped me.
    Thank you again.

  4. Nimayneb

    Thanks for your post. I also didn’t find anything about the migration of Webhooks for packagist… But I was really wondering… is this really a good approach for packagist Webhook? I cannot see which Packagist-Package-URL I have implemented via the “secret” string. What the heck?

    But the other problem is: I still have “Legacy Auto-Updated” and “Not Auto-Updated” with the “Needs Attention” hint on packagist account…

  5. Nimayneb

    Ehm. okay, my fault. I need one webhook for one repository of course. just confusing me first. 😉

  6. Mike

    You didn’t specify which events are required nor the checkboxes are visible on the screenshot.

Leave a Reply

Your email address will not be published.