mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
Fix dir not found handling (#5533)
This commit is contained in:
@@ -286,8 +286,11 @@ func (c *Forgejo) Dir(ctx context.Context, u *model.User, r *model.Repo, b *mode
|
||||
}
|
||||
|
||||
// List files in repository
|
||||
contents, _, err := client.ListContents(r.Owner, r.Name, b.Commit, f)
|
||||
contents, resp, err := client.ListContents(r.Owner, r.Name, b.Commit, f)
|
||||
if err != nil {
|
||||
if resp != nil && resp.StatusCode == http.StatusNotFound {
|
||||
return nil, errors.Join(err, &forge_types.ErrConfigNotFound{Configs: []string{f}})
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -288,8 +288,11 @@ func (c *Gitea) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model.
|
||||
}
|
||||
|
||||
// List files in repository
|
||||
contents, _, err := client.ListContents(r.Owner, r.Name, b.Commit, f)
|
||||
contents, resp, err := client.ListContents(r.Owner, r.Name, b.Commit, f)
|
||||
if err != nil {
|
||||
if resp != nil && resp.StatusCode == http.StatusNotFound {
|
||||
return nil, errors.Join(err, &forge_types.ErrConfigNotFound{Configs: []string{f}})
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user