From 391d54cd4e92583c906428bd5aadb1bcc4f49bd8 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 3 Sep 2024 20:46:20 +0400 Subject: [PATCH] Add repository to data --- internal/pusher/pusher.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/pusher/pusher.go b/internal/pusher/pusher.go index 1c131585..1f2b127b 100644 --- a/internal/pusher/pusher.go +++ b/internal/pusher/pusher.go @@ -31,10 +31,11 @@ import ( // Client represents a MongoDB client. type Client struct { - c *mongo.Client - database string - hostname string - runner string + c *mongo.Client + database string + hostname string + runner string + repository string } // New creates a new MongoDB client with given URI. @@ -68,10 +69,11 @@ func New(uri string) (*Client, error) { } return &Client{ - c: c, - database: database, - hostname: hostname, - runner: os.Getenv("RUNNER_NAME"), + c: c, + database: database, + hostname: hostname, + runner: os.Getenv("RUNNER_NAME"), + repository: os.Getenv("GITHUB_REPOSITORY"), }, nil } @@ -91,6 +93,7 @@ func (c *Client) Push(ctx context.Context, config, database string, res map[stri {"env", bson.D{ {"runner", c.runner}, {"hostname", c.hostname}, + {"repository", c.repository}, }}, {"passed", passed}, }