Package io.jenkins.plugins.ghacloud
Class GitHubClient
java.lang.Object
io.jenkins.plugins.ghacloud.GitHubClient
Minimal GitHub REST API client for triggering workflow_dispatch events.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResult of a workflow dispatch containing the run ID and URLs.static classRepresents the status of a GitHub Actions workflow run. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateWorkflowAnnotation(String repository, long runId, String message, String buildUrl) Creates a notice annotation on a workflow run by posting a check run with an annotation output.getWorkflowRunStatus(String repository, long runId) Gets the current status of a workflow run.Triggers a workflow_dispatch event on the specified repository and workflow file.voidupdateWorkflowRunName(String repository, long runId, String name) Updates the display name of a workflow run.
-
Constructor Details
-
GitHubClient
-
-
Method Details
-
triggerWorkflow
public GitHubClient.DispatchResult triggerWorkflow(String repository, String workflowFile, String ref, Map<String, String> inputs) throws IOExceptionTriggers a workflow_dispatch event on the specified repository and workflow file.- Parameters:
repository- owner/repoworkflowFile- 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
-
updateWorkflowRunName
Updates the display name of a workflow run.- Throws:
IOException
-
createWorkflowAnnotation
public void createWorkflowAnnotation(String repository, long runId, String message, String buildUrl) throws IOException Creates a notice annotation on a workflow run by posting a check run with an annotation output.- Parameters:
repository- owner/reporunId- the workflow run IDmessage- annotation messagebuildUrl- link back to the Jenkins build- Throws:
IOException
-