while loop in githubapi