PureDevOps Community

GitHub Hook not triggering Jenkins Pipeline Job

I verified all the github api is configured in jenkins and i have added the github_webhook url in github properly.
whenever there is a change or commit to the repo the hook getting posted to jenkins and I could see the relevant log in github webhook “recent deliveries”.
With all these the job in jenkins is not triggered and i see the jenkins log as below

INFO o.j.p.g.w.s.DefaultPushGHEventSubscriber#onEvent: Received PushEvent for https://github.com/Org/Project/

But there is another log should be there which is missing is "INFO o.j.p.g.w.s.DefaultPushGHEventSubscriber$1#run: Poked ". so that the job is not getting triggered.

Jenkins Job Type : Pipeline

After several hours of digging ,

  1. first thing i understood for a pipeline job is to trigger the job manually once
  2. if it is pipeline then the minimum requirement is to have the git url and the relevant branch defined like below
    agent any

    stages {
        stage('Init') {
            steps {
                // Get some code from a GitHub repository
                // Note:in the new github it is main and we usually have 'master'
                git branch: 'main', 
                  
                    url: 'git@github.com:<Org>/<proj>.git'
                    
                echo 'Success'
            }
        }
    }
}

with the above changes the job started triggering on each commit and relevant SCM changes identified in the branch.