Reduce code duplication using _get_repo and _check_token
These two utility methods allow us to reduce code duplication and
give us a single place where to retrieve projects and validate the API
token retrieved.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr></pingou@pingoured.fr>