Skip to content

Commit

Permalink
fix: skip app functionality when app isnt configured
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Dec 18, 2024
1 parent f9f0378 commit 5a39382
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scm/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@ func (c *client) GetNetrcPassword(ctx context.Context, db database.Interface, r

l.Tracef("getting netrc password for %s/%s", r.GetOrg(), r.GetName())

// no GitHub App configured, use legacy oauth token
if c.AppsTransport == nil {
return u.GetToken(), nil
}

var err error

// repos that the token has access to
Expand Down Expand Up @@ -770,6 +775,11 @@ func (c *client) SyncRepoWithInstallation(ctx context.Context, r *api.Repo) (*ap
"repo": r.GetName(),
}).Tracef("syncing app installation for repo %s/%s", r.GetOrg(), r.GetName())

// no GitHub App configured, skip
if c.AppsTransport == nil {
return r, nil
}

client, err := c.newGithubAppClient()
if err != nil {
return r, err
Expand Down

0 comments on commit 5a39382

Please sign in to comment.