Like what we’re doing? Star us on GitHub!

How can I trigger a Github Action with the `afterChange` hook? - HTTP webhooks?

gianpaj
last month
1 1

Would it make sense to add a Setting in the Menu to easily add a URL to add a Webhook?

Or should I hardcode the URL when I make the API call using the GitHub API to trigger a webhook event?

Context: I'm researching using this CMS to be able to trigger a static build of a Next.JS website made for SEO purposes.

  • denolfe
    Payload Team
    last month

    All configuration is typically done in the payload config and/or an .env file. This is where you would configure the URL and any other values.

    For GitHub API, the way to interact programmatically would be to use Octokit. So within your hook, you would instantiate Octokit, then use whatever methods they have available - likely something to do with a workflow run.

    1 reply
  • gianpaj
    last month

    That's great! thanks so much:)

Open the post
Continue the discussion in GitHub
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More