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:
		
							parent
							
								
									1f2b885740
								
							
						
					
					
						commit
						be0c0bd68f
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user