Skip to content

Commit

Permalink
Merge branch 'main' into fix-pypi-simple
Browse files Browse the repository at this point in the history
  • Loading branch information
GiteaBot authored Apr 20, 2024
2 parents e569d14 + cb6814a commit 924abf8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions services/actions/notifier_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ func newNotifyInput(repo *repo_model.Repository, doer *user_model.User, event we
}
}

func newNotifyInputForSchedules(repo *repo_model.Repository) *notifyInput {
// the doer here will be ignored as we force using action user when handling schedules
return newNotifyInput(repo, user_model.NewActionsUser(), webhook_module.HookEventSchedule)
}

func (input *notifyInput) WithDoer(doer *user_model.User) *notifyInput {
input.Doer = doer
return input
Expand Down Expand Up @@ -485,7 +490,7 @@ func handleSchedules(
RepoID: input.Repo.ID,
OwnerID: input.Repo.OwnerID,
WorkflowID: dwf.EntryName,
TriggerUserID: input.Doer.ID,
TriggerUserID: user_model.ActionsUserID,
Ref: ref,
CommitSHA: commit.ID.String(),
Event: input.Event,
Expand Down Expand Up @@ -527,7 +532,7 @@ func DetectAndHandleSchedules(ctx context.Context, repo *repo_model.Repository)
// We need a notifyInput to call handleSchedules
// if repo is a mirror, commit author maybe an external user,
// so we use action user as the Doer of the notifyInput
notifyInput := newNotifyInput(repo, user_model.NewActionsUser(), webhook_module.HookEventSchedule)
notifyInput := newNotifyInputForSchedules(repo)

return handleSchedules(ctx, scheduleWorkflows, commit, notifyInput, repo.DefaultBranch)
}

0 comments on commit 924abf8

Please sign in to comment.