diff --git a/server/cron/cron.go b/server/cron/cron.go index 5fc86f7f3..cb175b18b 100644 --- a/server/cron/cron.go +++ b/server/cron/cron.go @@ -121,7 +121,7 @@ func CreatePipeline(ctx context.Context, store store.Store, cron *model.Cron) (* cron.Branch = repo.Branch } - creator, err := store.GetUser(cron.CreatorID) + repoUser, err := store.GetUser(repo.UserID) if err != nil { return nil, nil, err } @@ -129,9 +129,9 @@ func CreatePipeline(ctx context.Context, store store.Store, cron *model.Cron) (* // If the forge has a refresh token, the current access token // may be stale. Therefore, we should refresh prior to dispatching // the pipeline. - forge.Refresh(ctx, _forge, store, creator) + forge.Refresh(ctx, _forge, store, repoUser) - commit, err := _forge.BranchHead(ctx, creator, repo, cron.Branch) + commit, err := _forge.BranchHead(ctx, repoUser, repo, cron.Branch) if err != nil { return nil, nil, err }