I have setup a GitHub personal access token, and I can successfully checkout and build my project from Jenkins. However, polling fails with the following message appearing in the Git Polling Log:
Using strategy: Default
[poll] Last Built Revision: Revision c6503c37fd0bdf3ec7df79731afdcdfe14dd7f86 (refs/remotes/origin/main)
The recommended git tool is: NONE
No credentials specified
> git --version # timeout=10
> git --version # 'git version 1.8.3.1'
Setting http proxy: proxy.xxxxxx.xxx:80
> git ls-remote -h https://oauth2@github.com/xxxx-xx/xxxxxxxxxx.git # timeout=10
FATAL: hudson.plugins.git.GitException: Command "git ls-remote -h https://oauth2@github.com/xxxxx-xx/xxxxxxxxxx.git" returned status code 128:
stdout:
stderr: remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://oauth2@github.com/xxxxx-xx/xxxxxxxxxx.git/'
The strange thing is, the polling does NOT use the token, as specified on the Jenkins configuration, "Source Code Management" Tab. where I have: https://oauth2:[token]@github.com/xxxx-xx/xxxxxxxxx.git
but the poll tool uses (as evidenced from the log above): https://oauth2@github.com/xxxx-xx/xxxxxxxxxx.git (no token supplied)
How can I configure the git polling tool to use the correct, token included URL ?
Jenkins Version : 2.346.2