mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-12 09:37:14 +02:00
chore(piepline): add runtime package.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@ -83,3 +83,22 @@ func (p *HTTPClient) Ping(ctx context.Context, machine string) error {
|
||||
_, err := client.Ping(ctx, req)
|
||||
return err
|
||||
}
|
||||
|
||||
// Ping sends a ping message to the server to test connectivity.
|
||||
func (p *HTTPClient) Request(ctx context.Context) (*v1.Stage, error) {
|
||||
client := v1connect.NewRunnerServiceClient(
|
||||
p.Client,
|
||||
p.Endpoint,
|
||||
p.opts...,
|
||||
)
|
||||
req := connect.NewRequest(&v1.ConnectRequest{})
|
||||
|
||||
req.Header().Set("X-Gitea-Token", p.Secret)
|
||||
|
||||
res, err := client.Connect(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res.Msg.Stage, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user