Which statement best describes how a webhook triggers a Jenkins job from GitHub?
Think about who initiates the communication when code changes happen.
GitHub webhooks send an HTTP POST request to Jenkins when a specified event happens, such as a push. Jenkins listens for this request and triggers the job accordingly.
What will Jenkins log show if it receives a webhook payload from GitLab with an invalid secret token?
Started by GitLab push webhook. Secret token does not match. Ignoring the request.
Check what happens when the secret token is wrong.
Jenkins verifies the secret token sent with the webhook. If it does not match the configured token, Jenkins ignores the request and logs this message.
Which Jenkinsfile snippet correctly configures a pipeline to trigger only on GitHub pull request events using a webhook?
pipeline {
agent any
triggers {
githubPullRequest()
}
stages {
stage('Build') {
steps {
echo 'Building pull request...'
}
}
}
}Look for the trigger that listens specifically to pull requests.
The githubPullRequest() trigger listens for pull request events from GitHub webhooks and triggers the pipeline accordingly.
You configured a GitLab webhook to trigger Jenkins on push events. The webhook URL is correct, but Jenkins does not start the job. What is the most likely cause?
Check the security settings that validate webhook authenticity.
If the secret token in Jenkins and GitLab webhook settings do not match, Jenkins will ignore the webhook even if the URL is correct.
Arrange the steps in the correct order to set up a GitHub webhook that triggers a Jenkins pipeline on push events.
Think about setting security before adding webhook and testing.
First generate and configure the secret token in Jenkins and GitHub (3), then create the Jenkins job (1), add the webhook in GitHub (2), and finally test by pushing code (4).