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

default discord avatar
gianpajlast year
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
    last year

    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
    gianpajlast year

    That's great! thanks so much:)

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.