Skip to content

Commit d7c4a4c

Browse files
authored
Merge pull request #10 from devicecloud-dev/move-validation-to-cli
let the cli do validation
2 parents bed8a39 + 15b0d1a commit d7c4a4c

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "dcd-github-action",
33
"description": "run maestro tests on devicecloud.dev",
44
"author": "devicecloud.dev",
5-
"version": "1.2.1",
5+
"version": "1.2.2",
66
"main": "src/index.ts",
77
"license": "MIT",
88
"engines": {

src/methods/params.ts

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,53 +53,21 @@ function parseTags(tags?: string): string[] | null {
5353
function parseAndroidDevice(device?: string): string | null {
5454
if (device === undefined || device === '') return null;
5555

56-
if (
57-
[
58-
'pixel-6',
59-
'pixel-6a',
60-
'pixel-6-pro',
61-
'pixel-7',
62-
'pixel-7-pro',
63-
'generic-tablet',
64-
].includes(device)
65-
) {
66-
return device;
67-
}
68-
69-
throw new Error(`Invalid android device: ${device}`);
56+
return device;
7057
}
58+
7159
function parseIOSDevice(device?: string): string | null {
7260
if (device === undefined || device === '') return null;
7361

74-
if (
75-
[
76-
'iphone-12',
77-
'iphone-12-mini',
78-
'iphone-12-pro-max',
79-
'iphone-13',
80-
'iphone-13-mini',
81-
'iphone-13-pro-max',
82-
'iphone-14',
83-
'iphone-14-plus',
84-
'iphone-14-pro',
85-
'iphone-14-pro-max',
86-
'iphone-15',
87-
'iphone-15-plus',
88-
'iphone-15-pro',
89-
'iphone-15-pro-max',
90-
'ipad-pro-6th-gen',
91-
].includes(device)
92-
) {
93-
return device;
94-
}
95-
96-
throw new Error(`Invalid ios device: ${device}`);
62+
return device;
9763
}
64+
9865
function getPullRequestTitle(): string | undefined {
9966
const pullRequestTitle = github.context.payload.pull_request?.title;
10067
if (pullRequestTitle === undefined) return undefined;
10168
return `${pullRequestTitle}`;
10269
}
70+
10371
function getInferredName(): string {
10472
const pullRequestTitle = getPullRequestTitle();
10573
if (pullRequestTitle) return pullRequestTitle;

0 commit comments

Comments
 (0)