fixed 组织流水线运行数据判断是否有文件存在

This commit is contained in:
xxq250 2025-04-21 16:25:39 +08:00
parent 7ff07e9c29
commit 9c593b1271
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
class Api::V1::Projects::Actions::RunsController < Api::V1::Projects::Actions::BaseController
def index
@files = $gitea_client.get_repos_contents_by_owner_repo_filepath(@project&.owner&.login, @project&.identifier, ".gitea/workflows/#{params[:workflow]}") rescue []
@files = $gitea_client.get_repos_contents_by_owner_repo_filepath(@project&.owner&.login, @project&.identifier, ".gitea/workflows") rescue []
@has_file = @files.select { |i| i['name'] == params[:workflow] }.present?
if @has_file
@result_object = Api::V1::Projects::Actions::Runs::ListService.call(@project, {workflow: params[:workflow], page: page, limit: limit}, current_user&.gitea_token)