mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-03-30 16:09:40 +00:00
Merge branch 'origin/main' into 'next-release/main'
This commit is contained in:
commit
ea132352e8
2 changed files with 8 additions and 3 deletions
|
@ -58,6 +58,7 @@ steps:
|
||||||
test:
|
test:
|
||||||
depends_on:
|
depends_on:
|
||||||
- install-dependencies
|
- install-dependencies
|
||||||
|
- format-check # wait for it else test artifacts are falsely detected as wrong
|
||||||
image: *node_image
|
image: *node_image
|
||||||
directory: web/
|
directory: web/
|
||||||
commands:
|
commands:
|
||||||
|
|
|
@ -615,10 +615,14 @@ func repairRepo(c *gin.Context, repo *model.Repo, withPerms, skipOnErr bool) {
|
||||||
user, err := _store.GetUser(repo.UserID)
|
user, err := _store.GetUser(repo.UserID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, types.RecordNotExist) {
|
if errors.Is(err, types.RecordNotExist) {
|
||||||
if !skipOnErr {
|
oldUserID := repo.UserID
|
||||||
c.AbortWithStatus(http.StatusNotFound)
|
user = session.User(c)
|
||||||
|
repo.UserID = user.ID
|
||||||
|
err = _store.UpdateRepo(repo)
|
||||||
|
if err != nil {
|
||||||
|
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
}
|
}
|
||||||
log.Error().Err(err).Msg("could not get user on repo repair")
|
log.Debug().Msgf("Could not find repo user with ID %d during repo repair, set to repair request user with ID %d", oldUserID, user.ID)
|
||||||
} else {
|
} else {
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue