更改:github webhook特殊处理

This commit is contained in:
yystopf 2024-05-11 11:43:23 +08:00
parent 28ed60da16
commit 362aee1a35
1 changed files with 1 additions and 1 deletions

View File

@ -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