trigger jenkins jobs only when a specific branch is updated I require a setup in jenkins, which enables me to trigger a jenkins job based on a push event to a specific branch in github. tried so many methods neither worked.
Install the git plugin, add credentials for the account you want it to use, then set the job to use SCM Polling. It will check on a preset interval for changes to that repo and trigger when changes are detected. If you need instant triggering upon push, you're looking for webhooks, which is significantly more difficult to set up. I find that polling every 2 minutes or so is good enough in most cases. Here's a decent example: https://www.baeldung.com/jenkins-job-schedule