From 0f2272ef7852a8c65c698502365f61ac99a5e5b7 Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Mon, 11 Nov 2024 12:21:02 -0700 Subject: [PATCH] re-build github actions code --- .../javascript/checkAndroidStatus/index.js | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/actions/javascript/checkAndroidStatus/index.js b/.github/actions/javascript/checkAndroidStatus/index.js index 25fb5f38616a..a998fe664b50 100644 --- a/.github/actions/javascript/checkAndroidStatus/index.js +++ b/.github/actions/javascript/checkAndroidStatus/index.js @@ -736552,21 +736552,21 @@ async function checkAndroidStatus() { }); const androidApi = googleapis_1.google.androidpublisher({ version: 'v3', - auth: auth, + auth, }); try { // Insert an edit to get an edit ID const editResponse = await androidApi.edits.insert({ packageName: PACKAGE_NAME, }); - const editId = editResponse.data.id; + const editId = editResponse.data.id ?? 'undefined'; // Get the production track status const trackResponse = await androidApi.edits.tracks.get({ packageName: PACKAGE_NAME, - editId: editId, + editId, track: 'production', }); - const status = trackResponse.data.releases?.[0]?.status || 'undefined'; + const status = trackResponse.data.releases?.[0]?.status ?? 'undefined'; console.log('Track status:', status); // Check if the status is halted const HALTED = status === HALTED_STATUS; @@ -736594,20 +736594,27 @@ function calculateRolloutPercentage(releaseDate) { const current = new Date(); const daysSinceRelease = Math.floor((current.getTime() - release.getTime()) / (1000 * 60 * 60 * 24)); console.log('Days since release:', daysSinceRelease); - if (daysSinceRelease <= 0) + if (daysSinceRelease <= 0) { return 0; - if (daysSinceRelease === 1) + } + if (daysSinceRelease === 1) { return 0.01; - if (daysSinceRelease === 2) + } + if (daysSinceRelease === 2) { return 0.02; - if (daysSinceRelease === 3) + } + if (daysSinceRelease === 3) { return 0.05; - if (daysSinceRelease === 4) + } + if (daysSinceRelease === 4) { return 0.1; - if (daysSinceRelease === 5) + } + if (daysSinceRelease === 5) { return 0.2; - if (daysSinceRelease === 6) + } + if (daysSinceRelease === 6) { return 0.5; + } return 1; } checkAndroidStatus()