In the JAMstack build workflow, it is not possible to get dynamic content from an external API and generate a static site.
Specifically, if I set the repository_dispatch as the trigger for GitHub Actions, Azure/[email protected] will fail as shown in the screenshot. It's probably a JSON payload issue.

A typical scenario for JAMstack is to access an online Headless CMS like Contentful in the build workflow to generate static content.
Currently, Azure Static Web Apps doesn't exactly support JAMstack; GitHub Push or PR-based content updates are called SSG (Static Site Generate) rather than JAMstack.
Are you able to provide a GitHub repo as an example?
The repo that have validated this Issue is here,
During Nuxt.js generate, it gets dynamic contents from Contentful API and generates static files.
As you can see in the workflow history below, it succeeds on the commit trigger, but fails on the repository dispatch(webhook) trigger.
Thank @k-miyake
@k-miyake I'll take a look at this, thanks for reporting it!
I have the same issue. When I trigger the GitHub Action workflow with the repository_dispatch event, it gets the error like the screenshot above. Both push and pull_request events are fine.

Yes this is a bug. The Build and Deploy Github Action looks for some event data provided by Github, but I believe the repository dispatch event does not provide this. We are working on removing this dependency but it will take some time. For now we can make this error clearer until we have the proper support in place.
@miwebst Hopefully this will be fixed as soon as possible. If it's going to take a long time, it's better to note it in the documentation FAQ.
@miwebst Thank you!
Many use cases rely on the repository_dispatch event such as manual deployment, scheduled deployment that is not covered by the schedule event, or approval process using the other approach - ChatOps or GitOps.
It would be great if this bug gets fixed sooner rather than later.
I'm also having the same problem with my Blazor app. Would much appreciate for the fix. 馃檹馃徏 This is one of the huge benefits I like about Azure Static Web App.
This should be fixed now, please let us know if you continue to run into this issue!
@miwebst
The repository_dispatch trigger makes it possible for me to build and deploy successfully has been checked.
Here's the GitHub Actions log.
https://github.com/k-miyake/vacd-jamstack/runs/775400365?check_suite_focus=true
Thanks for the quick fix. Great job!
Most helpful comment
I have the same issue. When I trigger the GitHub Action workflow with the
repository_dispatchevent, it gets the error like the screenshot above. Bothpushandpull_requestevents are fine.