@@ -1418,14 +1418,23 @@ jobs:
14181418 assert .Equal (t , "user2/repo1" , webhookData .payloads [1 ].Repo .FullName )
14191419
14201420 // Call rerun ui api
1421- // Only a web UI API exists for cancelling workflow runs, so use the UI endpoint.
1421+ // Only a web UI API exists for rerunning workflow runs, so use the UI endpoint.
14221422 rerunURL := fmt .Sprintf ("/user2/repo1/actions/runs/%d/rerun" , webhookData .payloads [0 ].WorkflowRun .RunNumber )
14231423 req = NewRequestWithValues (t , "POST" , rerunURL , map [string ]string {
14241424 "_csrf" : GetUserCSRFToken (t , session ),
14251425 })
14261426 session .MakeRequest (t , req , http .StatusOK )
14271427
14281428 assert .Len (t , webhookData .payloads , 3 )
1429+
1430+ // 5. Validate the third webhook payload
1431+ assert .Equal (t , "workflow_run" , webhookData .triggeredEvent )
1432+ assert .Equal (t , "requested" , webhookData .payloads [2 ].Action )
1433+ assert .Equal (t , "queued" , webhookData .payloads [2 ].WorkflowRun .Status )
1434+ assert .Equal (t , repo1 .DefaultBranch , webhookData .payloads [2 ].WorkflowRun .HeadBranch )
1435+ assert .Equal (t , commitID , webhookData .payloads [2 ].WorkflowRun .HeadSha )
1436+ assert .Equal (t , "repo1" , webhookData .payloads [2 ].Repo .Name )
1437+ assert .Equal (t , "user2/repo1" , webhookData .payloads [2 ].Repo .FullName )
14291438}
14301439
14311440func testWorkflowRunEventsOnCancellingAbandonedRun (t * testing.T , webhookData * workflowRunWebhook , allJobsAbandoned bool ) {
0 commit comments