Skip to content

Commit 55c5308

Browse files
GiteaBotZettat123
andauthored
Implement MigrateRepository for the actions notifier (#28920) (#28923)
Backport #28920 by @Zettat123 Fixes #28699 This PR implements the `MigrateRepository` method for `actionsNotifier` to detect the schedules from the workflow files in the migrated repository. Co-authored-by: Zettat123 <zettat123@gmail.com>
1 parent 8766f65 commit 55c5308

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

services/actions/notifier.go

+12
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,15 @@ func (n *actionsNotifier) DeleteWikiPage(ctx context.Context, doer *user_model.U
566566
Page: page,
567567
}).Notify(ctx)
568568
}
569+
570+
// MigrateRepository is used to detect workflows after a repository has been migrated
571+
func (n *actionsNotifier) MigrateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository) {
572+
ctx = withMethod(ctx, "MigrateRepository")
573+
574+
newNotifyInput(repo, doer, webhook_module.HookEventRepository).WithPayload(&api.RepositoryPayload{
575+
Action: api.HookRepoCreated,
576+
Repository: convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm_model.AccessModeOwner}),
577+
Organization: convert.ToUser(ctx, u, nil),
578+
Sender: convert.ToUser(ctx, doer, nil),
579+
}).Notify(ctx)
580+
}

0 commit comments

Comments
 (0)