mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
更改:webhook优化
This commit is contained in:
@@ -73,11 +73,17 @@ class Api::V1::Projects::SyncRepositories::CreateService < ApplicationService
|
||||
end
|
||||
|
||||
def create_webhook
|
||||
url = ""
|
||||
if type == "SyncRepositories::Gitee"
|
||||
url = "#{Rails.application.config_for(:configuration)['platform_url']}/api/v1/#{project&.owner&.login}/#{project&.identifier}/sync_repositories/sync?sync_direction=1&repo_type=SyncRepositories::Gitee"
|
||||
else
|
||||
url = "#{Rails.application.config_for(:configuration)['platform_url']}/api/v1/#{project&.owner&.login}/#{project&.identifier}/sync_repositories/sync?sync_direction=1&repo_type=SyncRepositories::Github"
|
||||
end
|
||||
webhook_params = {
|
||||
active: true,
|
||||
branch_filter: '*',
|
||||
http_method: 'POST',
|
||||
url: "#{Rails.application.config_for(:configuration)['platform_url']}/api/v1/#{project&.owner&.login}/#{project&.identifier}/sync_repositories/sync?sync_direction=1",
|
||||
url: url,
|
||||
content_type: 'json',
|
||||
type: 'reposync',
|
||||
events: ["push"]
|
||||
|
||||
Reference in New Issue
Block a user