When attempting to authenticate with a public GitHub repository by supplying a username and no password, if Git Credential Manager for Windows is installed it will launch an interactive child process in the background that waits for you to enter your GitHub credentials. Since Bamboo is being running the git command for change detection in an automated, non-interactive fashion – this process will never receive the credentials and terminate, so Bamboo will keep the build in the 'queued' state until the configured command timeout on the repository is reached with a log entry similar to the following:
- If technically feasible, it'd be fantastic if we could detect that this was occurring and either bypass the credential manager in some fashion or kill the build earlier with an error message.
- We could also get around this by allowing the GitHub plugin to authenticate in an anonymous fashion with a public GitHub repo since this appears to only occur when you authenticate with just a username. Username is a mandatory field in the GitHub plugin. The Bitbucket cloud plugin allows you to choose public access without a username or private.
- First check to see if any credentials have been stored for the repository under Windows Control Panel > Credential Manager > Generic Credentials. Depending on previous authentication attempts, sometimes the credential manager can store just the username here and all subsequent attempts will launch the interactive git-credential-manager.exe with the GitHub login prompt UI – so it's best to clear this entry first.
- From command-line, run a git command to the repo. I.E: git ls-remote https://email@example.com/repository-owner/repo.git
- When prompted for a password, enter it. This will store your user/pass in the credential vault and it won't prompt for it again when the same command is executed from Bamboo.
- Alternatively, you can also add your password to the repository configuration in Bamboo to bypass the credential manager prompt.
Another workaround: Instead of using a GitHub type repository in Bamboo to access a public repository, you can use a repository of type 'Git' and point it to the public GitHub URL. The difference being that in the GitHub repository in Bamboo, the Username is a mandatory field, so you cannot authenticate with a public repository anonymously as you can with the Git repository.