diff --git a/.github/actions/javascript/postTestBuildComment/index.js b/.github/actions/javascript/postTestBuildComment/index.js index 056981465e1e..8906bb597d63 100644 --- a/.github/actions/javascript/postTestBuildComment/index.js +++ b/.github/actions/javascript/postTestBuildComment/index.js @@ -11512,23 +11512,19 @@ function getTestBuildMessage() { const result = inputs.reduce((acc, platform) => { const input = core.getInput(platform, { required: false }); if (!input) { - return { - ...acc, - [platform]: { link: 'N/A', qrCode: 'N/A' }, - }; + acc[platform] = { link: 'N/A', qrCode: 'N/A' }; + return acc; } const isSuccess = input === 'success'; const link = isSuccess ? core.getInput(`${platform}_LINK`) : '❌ FAILED ❌'; const qrCode = isSuccess ? `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})` : `The QR code can't be generated, because the ${names[platform]} build failed`; - return { - ...acc, - [platform]: { - link, - qrCode, - }, + acc[platform] = { + link, + qrCode, }; + return acc; }, {}); const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: | Android :robot: | iOS :apple: | diff --git a/.github/actions/javascript/postTestBuildComment/postTestBuildComment.ts b/.github/actions/javascript/postTestBuildComment/postTestBuildComment.ts index 5b56a2420f37..813665f2dff5 100644 --- a/.github/actions/javascript/postTestBuildComment/postTestBuildComment.ts +++ b/.github/actions/javascript/postTestBuildComment/postTestBuildComment.ts @@ -1,6 +1,6 @@ import * as core from '@actions/core'; import {context} from '@actions/github'; -import {TupleToUnion} from 'type-fest'; +import type {TupleToUnion} from 'type-fest'; import CONST from '@github/libs/CONST'; import GithubUtils from '@github/libs/GithubUtils'; @@ -17,10 +17,8 @@ function getTestBuildMessage(): string { const input = core.getInput(platform, {required: false}); if (!input) { - return { - ...acc, - [platform]: {link: 'N/A', qrCode: 'N/A'}, - }; + acc[platform] = {link: 'N/A', qrCode: 'N/A'}; + return acc; } const isSuccess = input === 'success'; @@ -30,13 +28,11 @@ function getTestBuildMessage(): string { ? `![${names[platform]}](https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=${link})` : `The QR code can't be generated, because the ${names[platform]} build failed`; - return { - ...acc, - [platform]: { - link, - qrCode, - }, + acc[platform] = { + link, + qrCode, }; + return acc; }, {} as Record, {link: string; qrCode: string}>); const message = `:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: