GitHub Pages only serves static files. Point your HTML or Jekyll form at Formcask to collect messages.
GitHub Pages serves static files. It will not run PHP, a Node server, or a form handler. You can still have a working contact page by posting the form to Formcask.
For a plain HTML Pages site, add this to contact.html or any page:
<form action="https://formcask.com/f/f_YOUR_FORM_ID" method="POST">
<label>Name <input type="text" name="name" required></label>
<label>Email <input type="email" name="email" required></label>
<label>Message <textarea name="message" required></textarea></label>
<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
<input type="hidden" name="_redirect" value="https://yourname.github.io/yoursite/thanks.html">
<button type="submit">Send</button>
</form>
Replace the redirect with your real Pages URL (or a custom domain). The value must start with https://.
If the site is a Jekyll Pages project, use the Jekyll include instead and set url in _config.yml to https://yourname.github.io or your custom domain. You do not need GitHub Actions or an approved Jekyll plugin for this.
Commit, wait for the Pages build, and send a test from the live github.io (or custom domain) URL. Submissions show up in the Formcask dashboard and by email on the Free plan.
Related: Jekyll · Plain HTML · Hugo