We are using GitHub and CircleCI. I know that pull request mergeability can be made to be dependent on the most recent commit, using status checks. Is there any way to make it depend on whether or not a build is running? How?
If you want to push a commit as part of the build process, my recommendation would be to do it in a separate branch. Maybe call it
builds or something. Then just limiting to one concurrent build would ensure no conflicts. Alternately, if what you are pushing is a version number, you could consider using tags instead. If it's some other kind of artifact, you might consider using an artifact repository like artifactory. Those are more designed for the outputs of builds, whereas git repositories are designed to hold the inputs to builds.
The reason locking merges is discouraged is it incentivizes developers to circumvent the normal process. So you might find them doing things like merging pull requests into each other, or otherwise making their pull requests larger than they normally would, in order to be able to get a pull request off their plate.