check whether the repo exists before doing any action