mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
Use repo user for cron
This commit is contained in:
+3
-3
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user