Skip to content

Commit

Permalink
Document additional notifyCommit parameters (jenkinsci#1477)
Browse files Browse the repository at this point in the history
See also https://github.com/jenkinsci/git-plugin/blob/a057f8460a26802bcc17acc13115371cf8fbcf69/src/main/java/hudson/plugins/git/GitStatus.java#L117-L119

There's no associated Jira issue for this change.  This is documentation only.

- [x] I have read the [CONTRIBUTING](https://github.com/jenkinsci/git-plugin/blob/master/CONTRIBUTING.adoc) doc
- [x] Documentation in README has been updated as necessary

There's no appropriate category for "Tyes of changes" except for maybe "Bug fix".  This is documenting an existing feature that was previously undocumented.
  • Loading branch information
samrocketman committed Jul 6, 2023
1 parent a057f84 commit cc0d683
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ Refer to webhook documentation for your repository:
* link:https://github.com/jenkinsci/gitea-plugin/blob/master/docs/README.md[Gitea]
* link:https://docs.tuleap.org/user-guide/code-versioning/git.html#jenkins-webhooks[Tuleap]

Other git repositories can use a link:https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks[post-receive hook] in the remote repository to notify Jenkins of changes.
Other git repositories can use a link:https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks[post-receive hook] in the remote repository to notify Jenkins of changes. The `notifyCommit` endpoint can take four parameters.

* `url` (required) should match the URL in which a Jenkins job is configured to clone.
* `branches` (optional) is a comma separated list of one or more branches meant for multi-branch pipelines.
* `sha1` (optional) the SHA1 Git commit hash which triggered the notification.
* `token` (optional) a secret token which must match the Jenkins configuration. Jenkins ignores non-matching token requests.

Add the following line in your `hooks/post-receive` file on the git server, replacing <URL of the Git repository> with the fully qualified URL you use when cloning the repository, and replacing <Access token> with a token generated by a Jenkins administrator using the "Git plugin notifyCommit access tokens" section of the "Configure Global Security" page.

....
Expand Down

0 comments on commit cc0d683

Please sign in to comment.