From 100d221e49136522007c4613f70d2bf0cd209cc9 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Tue, 27 May 2025 14:09:04 +0100 Subject: [PATCH] guard: insert identity env vars into git commands these should be accessible by hooks. Signed-off-by: oppiliappan --- guard/guard.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guard/guard.go b/guard/guard.go index f097067..439bcc2 100644 --- a/guard/guard.go +++ b/guard/guard.go @@ -159,6 +159,11 @@ func Run(ctx context.Context, cmd *cli.Command) error { gitCmd.Stdout = os.Stdout gitCmd.Stderr = os.Stderr gitCmd.Stdin = os.Stdin + gitCmd.Env = append(os.Environ(), + fmt.Sprintf("GIT_USER_DID=%s", identity.DID.String()), + fmt.Sprintf("GIT_USER_HANDLE=%s", identity.Handle.String()), + fmt.Sprintf("GIT_USER_PDS_ENDPOINT=%s", identity.PDSEndpoint()), + ) if err := gitCmd.Run(); err != nil { l.Error("command failed", "error", err) -- 2.51.2