Jenkins - Github Plugin - Using Personal Access Token post Aug13 update not working with url change

Viewed 6553

We were using Github plugin with Username and password credentials so far in our Jenkins setup.

However, after Aug 13th, this stopped working giving the error - stderr: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

As per the answer provided by in How to use Github Personal Access Token in Jenkins

I modified the URL to be https://<access token>@github.com/<userName>/<organization>/<repository>.git

But this is not working.

Am I missing any steps here ?

2 Answers

Create your Private access token using below URL

https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

After that In Jenkins Job under Source Code Management section, provide Git repository URL in the format https://access_Token_Number@github.com/<Your_Org>/yourRepoName.git

e.g if Repo name is abc,Organization is test and Token number is 12345678 then URL will be look like

https://12345678@github.com/test/abc.git

Screenshot: Git Private Access Token binding

This method resolved my problem.

This is not about changing URL. Jenkins is clearly indicating that it needs a Personal Access Token(PAT) instead of a password for git authorization.

Please create a PAT using the below link: [https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token][1]

Then go to Jenkins -> Configure Job -> Source Code Management and Change the Repository URL as follow: https://access_Token_Number@github.com/<Your_Org>/yourRepoName.git

  • Access Token Number: Its a PAT that you will generate using above shared link

  • Organization Name: The global name under which your repositories exist

  • RepoName: Name of your repository for which Jenkins job is configured

Related