Oh, that's a misunderstanding then. I think what was meant by "test every commit before allowing merge" was testing each individual commit in a PR branch, not just testing PRs before merging. I don't think your solution does this. :-(
It does exactly what you wanted it to. Feel free to email me if you need help setting it up, happy to help. Cheers!
I tested this here: https://github.com/liskin/nodejs-hello-world/pull/1