diff --git a/docs/docs/91-migrations.md b/docs/docs/91-migrations.md index d9af52e34..9e8603be8 100644 --- a/docs/docs/91-migrations.md +++ b/docs/docs/91-migrations.md @@ -2,14 +2,6 @@ Some versions need some changes to the server configuration or the pipeline configuration files. - - ## `next` - Removed `WOODPECKER_DEV_OAUTH_HOST` and `WOODPECKER_DEV_GITEA_OAUTH_URL` use `WOODPECKER_EXPERT_FORGE_OAUTH_HOST` @@ -26,6 +18,8 @@ Some versions need some changes to the server configuration or the pipeline conf - Removed `WOODPECKER_WEBHOOK_HOST` in favor of `WOODPECKER_EXPERT_WEBHOOK_HOST` - Migrated to rfc9421 for webhook signatures - Renamed `start_time`, `end_time`, `created_at`, `started_at`, `finished_at` and `reviewed_at` JSON fields to `started`, `finished`, `created`, `started`, `finished`, `reviewed` +- Update all webhooks by pressing the "Repair all" button in the admin settings as the webhook token claims have changed +- Crons now use standard Linux syntax without seconds ## 2.0.0 diff --git a/server/api/hook.go b/server/api/hook.go index 654acc93d..713fca39b 100644 --- a/server/api/hook.go +++ b/server/api/hook.go @@ -250,11 +250,8 @@ func PostHook(c *gin.Context) { func getRepoFromToken(store store.Store, t *token.Token) (*model.Repo, error) { // try to get the repo by the repo-id repoID, err := strconv.ParseInt(t.Get("repo-id"), 10, 64) - if err == nil { - return store.GetRepo(repoID) + if err != nil { + return nil, err } - - // try to get the repo by the repo name or by its redirection - repoName := t.Get("text") - return store.GetRepoName(repoName) + return store.GetRepo(repoID) }