更改:github webhook特殊处理
This commit is contained in:
parent
28ed60da16
commit
362aee1a35
|
@ -29,7 +29,7 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController
|
|||
else
|
||||
@sync_repositories = SyncRepository.where(project: @project, sync_direction: params[:sync_direction])
|
||||
end
|
||||
branch = params[:ref].split("refs/heads/")[-1]
|
||||
branch = params[:payload].present? ? JSON.parse(params[:payload])["ref"].split("/")[-1] : params[:ref].split("/")[-1] rescue nil
|
||||
if params[:sync_direction].to_i == 1
|
||||
@sync_repository_branches = SyncRepositoryBranch.where(sync_repository_id: @sync_repositories, gitlink_branch_name: branch, enable: true)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue