Required checks not triggering on automatic commits

We have a workflow for PRs that automatically re-generates documentation for the updated code and creates a new commit with it in the PR.

Our problem is that we have some required checks/tests as well, and when the new commit happens the status of the checks are cleared and the PR waits for new runs of the tests. But checks are not triggered by automatic commits like this. So the result is that the PR becomes unmergable due to “Required statuses must pass before merging” even due to checks ran successful before the automatic commit.

Any suggestions on how to make automatic commits work with required checks?

I guess you’re using the GITHUB_TOKEN to push? In that case you won’t get a new workflow run, as described in the documentation on Using the GITHUB_TOKEN in a workflow:

When you use the repository’s GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs.

If you want to create new workflow runs, the easiest solution is to use a PAT instead.