From 9594d36d4aecc8bf125bab1b3a2cd889a00c3012 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Mon, 22 Jul 2024 15:32:18 +0200 Subject: [PATCH] [LOCAL][RN][Release] Add logging to E2E test script (#45532) --- .../release-testing/utils/github-actions-utils.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/release-testing/utils/github-actions-utils.js b/scripts/release-testing/utils/github-actions-utils.js index 1efd6353852..a5912d3d0da 100644 --- a/scripts/release-testing/utils/github-actions-utils.js +++ b/scripts/release-testing/utils/github-actions-utils.js @@ -60,7 +60,7 @@ const reactNativeRepo = 'https://api.github.com/repos/facebook/react-native/'; const reactNativeActionsURL = `${reactNativeRepo}actions/runs`; async function _getActionRunsOnBranch() /*: Promise */ { - const url = `${reactNativeActionsURL}?branch=${branch}`; + const url = `${reactNativeActionsURL}?branch=${branch}&per_page=100`; const options = { method: 'GET', headers: ciHeaders, @@ -123,7 +123,17 @@ async function initialize( const testAllWorkflow = (await _getActionRunsOnBranch()).workflow_runs .filter(w => w.name === 'Test All') - .sort((a, b) => (a.created_at > b.created_at ? -1 : 1))[0]; + .sort( + (a, b) => + new Date(b.created_at).getTime() - new Date(a.created_at).getTime(), + )[0]; + + console.warn( + `\nUsing workflow created at ${testAllWorkflow.created_at} with id ${testAllWorkflow.id}`, + ); + console.warn( + `See it at: https://github.com/facebook/react-native/actions/runs/${testAllWorkflow.id}\n`, + ); artifacts = await _getArtifacts(testAllWorkflow.id); }