You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Use forge IDs for hook tokens (#4897)
Co-authored-by: Robert Kaussow <xoxys@rknet.org> Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
This commit is contained in:
@@ -248,7 +248,18 @@ 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
|
||||
if t.Get("repo-forge-remote-id") != "" {
|
||||
// TODO: use both the forge ID and repo forge remote ID
|
||||
/*forgeID, err := strconv.ParseInt(t.Get("forge-id"), 10, 64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}*/
|
||||
|
||||
return store.GetRepoForgeID(model.ForgeRemoteID(t.Get("repo-forge-remote-id")))
|
||||
}
|
||||
|
||||
// get the repo by the repo-id
|
||||
// TODO: remove in next major
|
||||
repoID, err := strconv.ParseInt(t.Get("repo-id"), 10, 64)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user