mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-31 22:38:58 +00:00
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>
This commit is contained in:
parent
8766f65add
commit
55c53080d1
1 changed files with 12 additions and 0 deletions
|
@ -566,3 +566,15 @@ func (n *actionsNotifier) DeleteWikiPage(ctx context.Context, doer *user_model.U
|
||||||
Page: page,
|
Page: page,
|
||||||
}).Notify(ctx)
|
}).Notify(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MigrateRepository is used to detect workflows after a repository has been migrated
|
||||||
|
func (n *actionsNotifier) MigrateRepository(ctx context.Context, doer, u *user_model.User, repo *repo_model.Repository) {
|
||||||
|
ctx = withMethod(ctx, "MigrateRepository")
|
||||||
|
|
||||||
|
newNotifyInput(repo, doer, webhook_module.HookEventRepository).WithPayload(&api.RepositoryPayload{
|
||||||
|
Action: api.HookRepoCreated,
|
||||||
|
Repository: convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm_model.AccessModeOwner}),
|
||||||
|
Organization: convert.ToUser(ctx, u, nil),
|
||||||
|
Sender: convert.ToUser(ctx, doer, nil),
|
||||||
|
}).Notify(ctx)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue