Class GitHubWebHook

java.lang.Object
com.cloudbees.jenkins.GitHubWebHook
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject, RootAction, UnprotectedRootAction

@Extension public class GitHubWebHook extends Object implements UnprotectedRootAction
Receives github hook.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • GitHubWebHook

      public GitHubWebHook()
  • Method Details

    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • registerHookFor

      @Deprecated public void registerHookFor(Job job)
      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

      public void registerHookFor(Item item)
      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

      public List<Item> reRegisterAllHooks()
      Calls registerHookFor(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 null
      payload - Payload from hook. Never blank
    • get

      public static GitHubWebHook get()
    • getJenkinsInstance

      @NonNull public static Jenkins getJenkinsInstance() throws IllegalStateException
      Throws:
      IllegalStateException