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

default discord avatar
8 months 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.

  • discord user avatar
    Payload Team
    8 months 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
    8 months ago

    That's great! thanks so much:)

Open the post
Continue the discussion in GitHub
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

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