1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix bug on downloading job logs (#34041)

Fix #34038
This commit is contained in:
Lunny Xiao
2025-03-27 17:20:56 -07:00
committed by GitHub
parent 894821d522
commit 321cbcb45a
2 changed files with 121 additions and 74 deletions

View File

@@ -22,7 +22,7 @@ func DownloadActionsRunJobLogsWithIndex(ctx *context.Base, ctxRepo *repo_model.R
if err = runJobs.LoadRepos(ctx); err != nil {
return fmt.Errorf("LoadRepos: %w", err)
}
if 0 < jobIndex || jobIndex >= int64(len(runJobs)) {
if jobIndex < 0 || jobIndex >= int64(len(runJobs)) {
return util.NewNotExistErrorf("job index is out of range: %d", jobIndex)
}
return DownloadActionsRunJobLogs(ctx, ctxRepo, runJobs[jobIndex])