diff options
author | Zettat123 <zettat123@gmail.com> | 2024-01-25 20:06:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 20:06:29 +0800 |
commit | 071b7b2a0308d3b65f2deafc0a004a340e6ead86 (patch) | |
tree | e87259d1e082126d8622ea1b73c056beabd038ad | |
parent | c46316f7aec1a00b3db74a3565008c44c0b0807f (diff) | |
download | gitea-071b7b2a0308d3b65f2deafc0a004a340e6ead86.tar.gz gitea-071b7b2a0308d3b65f2deafc0a004a340e6ead86.zip |
Implement `MigrateRepository` for the actions notifier (#28920)
Fixes #28699
This PR implements the `MigrateRepository` method for `actionsNotifier`
to detect the schedules from the workflow files in the migrated
repository.
-rw-r--r-- | services/actions/notifier.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/services/actions/notifier.go b/services/actions/notifier.go index 5a71d1cd79..0b4fed5db1 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -565,3 +565,15 @@ func (n *actionsNotifier) DeleteWikiPage(ctx context.Context, doer *user_model.U Page: page, }).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) +} |