chore(runtime): fetch build data

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-09-03 20:57:32 +08:00
committed by Jason Song
parent 631f801aa6
commit d3d56ed0ef
9 changed files with 77 additions and 78 deletions

View File

@ -153,3 +153,22 @@ func (p *HTTPClient) UpdateStep(ctx context.Context, arg *runnerv1.UpdateStepReq
return err
}
// Detail fetches build details
func (p *HTTPClient) Detail(ctx context.Context, arg *runnerv1.DetailRequest) (*runnerv1.DetailResponse, error) {
client := runnerv1connect.NewRunnerServiceClient(
p.Client,
p.Endpoint,
p.opts...,
)
req := connect.NewRequest(arg)
req.Header().Set("X-Runner-Token", p.Secret)
resp, err := client.Detail(ctx, req)
return &runnerv1.DetailResponse{
Repo: resp.Msg.Repo,
Build: resp.Msg.Build,
Stage: resp.Msg.Stage,
}, err
}