mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-16 09:45:57 +08:00
fixed 流水线重复生成
This commit is contained in:
@@ -20,7 +20,7 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
|
||||
project = Project.find_by(gpid: file_info.repo_id)
|
||||
next if project.blank?
|
||||
unless db_files.include?(".gitea/workflows/#{file}")
|
||||
pipeline = Action::Pipeline.new(pipeline_name: file.to_s.gsub(".yml", "").gsub(".yaml", ""),
|
||||
pipeline = Action::Pipeline.find_or_initialize_by(pipeline_name: file.to_s.gsub(".yml", "").gsub(".yaml", ""),
|
||||
file_name: ".gitea/workflows/#{file}",
|
||||
branch: project.default_branch,
|
||||
is_graphic_design: false,
|
||||
@@ -69,7 +69,6 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
|
||||
@pipelines = Action::Pipeline.where(project_id: @project_ids).order(updated_at: :desc)
|
||||
@pipelines = @pipelines.where("pipeline_name like ?", "%#{params[:pipeline_name]}%") if params[:pipeline_name].present?
|
||||
@pipelines = @pipelines.where(pipeline_type: params[:pipeline_type]) if params[:pipeline_type].present?
|
||||
@has_pipeline_ids = @pipelines.pluck(:project_id).uniq
|
||||
@pipelines = @pipelines
|
||||
@pipelines = paginate @pipelines
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
|
||||
@run_result = []
|
||||
@files.map { |i| i['name'] }.each do |file|
|
||||
unless db_files.include?(".gitea/workflows/#{file}")
|
||||
pipeline = Action::Pipeline.new(pipeline_name: file.to_s.gsub(".yml", "").gsub(".yaml", ""),
|
||||
pipeline = Action::Pipeline.find_or_initialize_by(pipeline_name: file.to_s.gsub(".yml", "").gsub(".yaml", ""),
|
||||
file_name: ".gitea/workflows/#{file}",
|
||||
branch: @project.default_branch,
|
||||
is_graphic_design: false,
|
||||
|
||||
Reference in New Issue
Block a user