Use repo user for cron

This commit is contained in:
Anbraten
2026-01-13 14:41:03 +01:00
parent 567f176b4d
commit 9179af2db5
+3 -3
View File
@@ -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
}