0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-04 15:04:00 +01:00

Fix test job ID and add LoadRun check in rerunJob

This commit is contained in:
Ross Golder 2025-10-23 22:10:35 +07:00
parent 1f2b885740
commit be0c0bd68f
No known key found for this signature in database
GPG Key ID: 253A7E508D2D59CD
2 changed files with 6 additions and 1 deletions

View File

@ -531,6 +531,11 @@ func getRunJobsAndCurrent(ctx *context.APIContext, runID, jobIndex int64) (*acti
}
func rerunJob(ctx *context.APIContext, job *actions_model.ActionRunJob, shouldBlock bool) error {
if job.Run == nil {
if err := job.LoadRun(ctx); err != nil {
return err
}
}
status := job.Status
if !status.IsDone() || !job.Run.Status.IsDone() {
return nil

View File

@ -272,7 +272,7 @@ func TestAPIActionsGetWorkflowJobLogs(t *testing.T) {
session := loginUser(t, user.Name)
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteRepository)
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/actions/runs/795/jobs/198/logs", repo.FullName())).
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/actions/runs/795/jobs/192/logs", repo.FullName())).
AddTokenAuth(token)
MakeRequest(t, req, http.StatusOK)