Browse Source

更改:github webhook特殊处理

pull/347/head
yystopf 2 years ago
parent
commit
362aee1a35
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/api/v1/projects/sync_repositories_controller.rb

+ 1
- 1
app/controllers/api/v1/projects/sync_repositories_controller.rb 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


Loading…
Cancel
Save