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 classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Receives the webhook callstatic GitHubWebHook
get()
static Jenkins
void
registerHookFor
(Item item) If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(item);
void
registerHookFor
(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:
-
-
Constructor Details
-
GitHubWebHook
public GitHubWebHook()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
- Specified by:
getUrlName
in 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
-
SCMEvent
based API, if wrong, please raise a JIRA