From 7411f66c696efc9a45263bf76b24acfec4167427 Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Fri, 5 Jan 2024 21:07:59 +0100 Subject: [PATCH] Avoid getting user when anonymous (#2074) Resolves regressions #2008 and #2014 introduced in #1029 Signed-off-by: Marco Nenciarini Co-authored-by: Keegan Campbell --- github/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/github/config.go b/github/config.go index e475389a76..a0b12ade65 100644 --- a/github/config.go +++ b/github/config.go @@ -107,6 +107,9 @@ func (c *Config) ConfigureOwner(owner *Owner) (*Owner, error) { ctx := context.Background() owner.name = c.Owner if owner.name == "" { + if c.Anonymous() { + return owner, nil + } // Discover authenticated user user, _, err := owner.v3client.Users.Get(ctx, "") if err != nil {