Then something else will need to be checking whatever condition you came up with . Currently, NOTHING clones your repo to be able to check anything in it before a build starts
You might be interested in this FR that would alow to run arbitrary user code early in the build:
Run a chunk of user code before the stock installation logic