Drop repo name fallback for hooks (#4013)

This commit is contained in:
qwerty287 2024-08-08 07:50:38 +02:00 committed by GitHub
parent 1156c22cd1
commit 0d9e57d3da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 14 deletions

View file

@ -2,14 +2,6 @@
Some versions need some changes to the server configuration or the pipeline configuration files.
<!--
## 3.0.0
- 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
-->
## `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

View file

@ -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)
}