新增:同步时间和创建数据返回

This commit is contained in:
2024-04-16 17:53:35 +08:00
parent e358e3b6f6
commit 7271603248
6 changed files with 15 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ class Api::V1::Projects::SyncRepositories::CreateService < ApplicationService
include ActiveModel::Model
attr_reader :project, :type, :external_token, :external_repo_address, :sync_granularity, :external_branch_name, :gitlink_branch_name, :first_sync_direction
attr_accessor :sync_repository1, :sync_repository2
attr_accessor :sync_repository1, :sync_repository2, :sync_repository_branch1, :sync_repository_branch2
validates :type, inclusion: {in: %w(SyncRepositories::Gitee SyncRepositories::Github)}
validates :external_repo_address, format: { with: CustomRegexp::URL_REGEX, multiline: true, message: "地址格式不正确" }
@@ -36,6 +36,8 @@ class Api::V1::Projects::SyncRepositories::CreateService < ApplicationService
touch_first_sync
end
create_webhook
[@sync_repository1, @sync_repository2, @sync_repository_branch1, @sync_repository_branch2]
end
def check_gitlink_branch_name