Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions go-libs/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ func (c *GitHubClient) ListRuns(ctx context.Context, org, repo, workflow string)
})
}

func (c *GitHubClient) DisableWorkflow(ctx context.Context, org, repo, workflow string) listing.Iterator[workflowRun] {
path := fmt.Sprintf("%s/repos/%s/%s/actions/workflows/%s/disable", gitHubAPI, org, repo, workflow)
err := c.api.Do(ctx, "PUT", path, httpclient)
return err
}

func (c *GitHubClient) EnableWorkflow(ctx context.Context, org, repo, workflow string) listing.Iterator[workflowRun] {
path := fmt.Sprintf("%s/repos/%s/%s/actions/workflows/%s/enable", gitHubAPI, org, repo, workflow)
err := c.api.Do(ctx, "PUT", path, httpclient)
return err
}

func (c *GitHubClient) ListWorkflowJobs(ctx context.Context, org, repo string, runID int64) listing.Iterator[WorkflowJob] {
path := fmt.Sprintf("%s/repos/%s/%s/actions/runs/%v/jobs", gitHubAPI, org, repo, runID)
return rawPaginator[WorkflowJob, Jobs, int64](ctx, c, path, &PageOptions{}, func(j Jobs) []WorkflowJob {
Expand Down