Package com.cloudbees.jenkins
Class GitHubWebHook
java.lang.Object
com.cloudbees.jenkins.GitHubWebHook
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject,RootAction,UnprotectedRootAction
Receives github hook.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReceives the webhook callstatic GitHubWebHookget()static JenkinsvoidregisterHookFor(Item item) If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(item);voidregisterHookFor(Job job) Deprecated.CallsregisterHookFor(Job)for every project which have subscriber
-
Field Details
-
URLNAME
- See Also:
-
URL_VALIDATION_HEADER
- See Also:
-
X_INSTANCE_IDENTITY
- See Also:
-
X_GITHUB_DELIVERY
X-GitHub-Delivery: A globally unique identifier (GUID) to identify the event.- See Also:
-
-
Constructor Details
-
GitHubWebHook
public GitHubWebHook()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
registerHookFor
Deprecated.If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(job);- Parameters:
job- not null project to register hook for
-
registerHookFor
If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(item);- Parameters:
item- not null item to register hook for- Since:
- 1.25.0
-
reRegisterAllHooks
CallsregisterHookFor(Job)for every project which have subscriber- Returns:
- list of jobs which jenkins tried to register hook
-
doIndex
public void doIndex(@NonNull @GHEventHeader org.kohsuke.github.GHEvent event, @NonNull @GHEventPayload String payload) Receives the webhook call- Parameters:
event- GH event type. Never nullpayload- Payload from hook. Never blank
-
get
-
getJenkinsInstance
- Throws:
IllegalStateException
-
SCMEventbased API, if wrong, please raise a JIRA