This is normal as the pull_request variable isn't available in the context anymore.
proposed solution
We deactivate this for push events. The push happens once the merge has been done, and the merge is blocked if the fixup commits exist.
So i don't see a need to do this twice as origin/main and HEAD will be the same ref.