Skip to content

Commit

Permalink
Fix linter again
Browse files Browse the repository at this point in the history
  • Loading branch information
jnowakow committed Dec 2, 2024
1 parent d7a73ca commit 17d78c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
16 changes: 6 additions & 10 deletions .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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';
Expand All @@ -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<TupleToUnion<typeof inputs>, {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:
Expand Down

0 comments on commit 17d78c7

Please sign in to comment.