Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
gianpaj2 years ago
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.

  • Selected Answer
    discord user avatar
    denolfe
    2 years ago

    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
  • default discord avatar
    gianpaj2 years ago

    That's great! thanks so much:)

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.