mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 05:11:04 +00:00
Drop repo name fallback for hooks (#4013)
This commit is contained in:
parent
1156c22cd1
commit
0d9e57d3da
2 changed files with 5 additions and 14 deletions
|
@ -2,14 +2,6 @@
|
||||||
|
|
||||||
Some versions need some changes to the server configuration or the pipeline configuration files.
|
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`
|
## `next`
|
||||||
|
|
||||||
- Removed `WOODPECKER_DEV_OAUTH_HOST` and `WOODPECKER_DEV_GITEA_OAUTH_URL` use `WOODPECKER_EXPERT_FORGE_OAUTH_HOST`
|
- 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`
|
- Removed `WOODPECKER_WEBHOOK_HOST` in favor of `WOODPECKER_EXPERT_WEBHOOK_HOST`
|
||||||
- Migrated to rfc9421 for webhook signatures
|
- 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`
|
- 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
|
## 2.0.0
|
||||||
|
|
||||||
|
|
|
@ -250,11 +250,8 @@ func PostHook(c *gin.Context) {
|
||||||
func getRepoFromToken(store store.Store, t *token.Token) (*model.Repo, error) {
|
func getRepoFromToken(store store.Store, t *token.Token) (*model.Repo, error) {
|
||||||
// try to get the repo by the repo-id
|
// try to get the repo by the repo-id
|
||||||
repoID, err := strconv.ParseInt(t.Get("repo-id"), 10, 64)
|
repoID, err := strconv.ParseInt(t.Get("repo-id"), 10, 64)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
return store.GetRepo(repoID)
|
return nil, err
|
||||||
}
|
}
|
||||||
|
return store.GetRepo(repoID)
|
||||||
// try to get the repo by the repo name or by its redirection
|
|
||||||
repoName := t.Get("text")
|
|
||||||
return store.GetRepoName(repoName)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue