Using actions to test the branch protection rules of a PR?

Is there a way to exclude the currently running job from holding the pull_request in mergeable_state=unstable? I’m using Github actions to deploy artifacts into my infrastructure when a PR is ready to merge. For various reasons I need to perform actions in this order: deploy the PR branch → validate the deployment → merge the PR into master.

At the start of my deployment job I need to exit with an error if the PR is not in a mergeable state because the branch protection rules aren’t satisfied. I thought I could use github-script to fetch the pull details and extract $pull.data.mergeable_state but the deployment job itself is considered to be a pending check and is causing the mergeable_state to be “unstable” rather than “clean”.

I could run these tests manually by checking if the PR has the proper number of reviewers, checking for merge conflicts, etc but this would mean duplicating the branch protection settings into the workflow code and updating it whenever the branch protection rules change. I’m hoping to avoid that.

Any advice?