fixed 流水线禁用状态最后查询

This commit is contained in:
xxq250 2025-04-09 15:13:13 +08:00
parent 5fd5431d5c
commit 3236bb37b0
1 changed files with 2 additions and 2 deletions

View File

@ -8,8 +8,6 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
@action_runs = Gitea::ActionRun.where(repo_id: @project.gpid)
group_data = @action_runs.where(status: [1,2]).group(:workflow_id, :status).count
db_files = pipelines.pluck(:file_name)
disabled_config = Gitea::RepoUnit.where(repo_id: @project.gpid, type: 10)&.first&.config
@disabled_workflows = disabled_config.present? ? JSON.parse(disabled_config)["DisabledWorkflows"] : []
@run_result = []
@files.map { |i| i['name'] }.each do |file|
unless db_files.include?(".gitea/workflows/#{file}")
@ -58,6 +56,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
}.merge(last_action_run_json)
end
Rails.logger.info("@run_result======#{@run_result}")
disabled_config = Gitea::RepoUnit.where(repo_id: @project.gpid, type: 10)&.first&.config
@disabled_workflows = disabled_config.present? ? JSON.parse(disabled_config)["DisabledWorkflows"] : []
@pipelines = Action::Pipeline.where(project_id: @project.id).order(updated_at: :desc)
@pipelines = paginate @pipelines
end