Create empty commit using Commits API

I’m attempting to create an empty commit on a branch, through the GitHub API, so I can trigger a GitHub Actions workflow to run.

I’ve tried using the Commits API (https://developer.github.com/v3/git/commits/#create-a-commit) but cannot figure out what to pass for a tree sha and keep getting “Tree SHA is not a tree object” error message.

Does anyone know how to achieve this using the API?

I was trying to do the same and ran across this package: https://github.com/bahmutov/make-empty-github-commit/blob/master/src/index.js . Looks like they just get the latest commit of the branch - they call it the ‘reference commit’ - copy the tree sha, and then just upload a new commit still pointing to the old one. That makes it effectively empty!