Add Github Project to a Jenkins Pipeline

Tiempo de lectura: 3 minutos

Reading time: 3 minutes

Hello and welcome, today we are going to learn how we can add a Github project in Jenkins.

The first thing we’re going to do is go to our Job created in Jenkins.

Now we go to Configure and then Pipeline.

We choose Pipeline script from SCM.

Now we choose SCM GIT and add the HTTPS URL of our Github project inside Repository URL:

Once added, we go to credentials and click on Add / Jenkins:

Now we choose Username with Password:

We enter our Username and generate the password.

To do this, we go back to Github and go to our account > settings > Developer Settings

Now we go to Personal access tokens > Create new token

We choose new token classic:

We choose the necessary configuration and click on generate.

Once generated, copy it and paste it into the password field in Jenkins:

We create an ID and a description for the created key:

Once added, click Save and select it. Now we can access our repository.

Now we can choose the branch we want to build with the pipeline:

And the path of the Jenkinsfile:

Leave a Comment