Class GitHubClient

java.lang.Object
io.jenkins.plugins.ghacloud.GitHubClient

public class GitHubClient extends Object
Minimal GitHub REST API client for triggering workflow_dispatch events.
  • Constructor Details

    • GitHubClient

      public GitHubClient(String apiUrl, String token)
  • Method Details

    • triggerWorkflow

      public GitHubClient.DispatchResult triggerWorkflow(String repository, String workflowFile, String ref, Map<String,String> inputs) throws IOException
      Triggers a workflow_dispatch event on the specified repository and workflow file.
      Parameters:
      repository - owner/repo
      workflowFile - the workflow filename (e.g. jenkins-agent.yml)
      ref - git ref to run against (e.g. main)
      inputs - key-value inputs forwarded to the workflow
      Returns:
      dispatch result containing the workflow run ID and URLs
      Throws:
      IOException
    • getWorkflowRunStatus

      public GitHubClient.WorkflowRunStatus getWorkflowRunStatus(String repository, long runId) throws IOException
      Gets the current status of a workflow run.
      Throws:
      IOException