Skip to content

Commit 7c09ee2

Browse files
riglarclaude
andcommitted
Add use-beta option to enable DCD CLI beta version
Adds a new 'use-beta' input parameter that allows users to opt into using the beta version of the DCD CLI (@devicecloud.dev/dcd@beta) instead of the latest stable version. This is useful for testing new features before they are released to stable. Changes: - Add 'use-beta' input to action.yml - Update Params type to include useBeta field - Modify getLatestDcdVersion to support beta tag - Bump version to 2.0.3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 97cf762 commit 7c09ee2

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ inputs:
100100
debug:
101101
description: 'Enable debug mode for more verbose output'
102102
required: false
103+
use-beta:
104+
description: 'Use the beta version of the DCD CLI instead of the latest stable version'
105+
required: false
103106

104107
outputs:
105108
DEVICE_CLOUD_CONSOLE_URL:

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": "2.0.1",
5+
"version": "2.0.3",
66
"main": "src/index.ts",
77
"license": "MIT",
88
"engines": {

src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ const getTestStatus = async (
7878
}
7979
};
8080

81-
const getLatestDcdVersion = async (): Promise<string> => {
81+
const getLatestDcdVersion = async (useBeta: boolean = false): Promise<string> => {
8282
try {
83+
if (useBeta) {
84+
console.info(`Using beta version of DCD CLI`);
85+
return `${dcdPackageName}@beta`;
86+
}
8387
const { output } = await executeCommand(
8488
`npm view ${dcdPackageName} version`,
8589
false
@@ -95,8 +99,6 @@ const getLatestDcdVersion = async (): Promise<string> => {
9599

96100
const run = async (): Promise<void> => {
97101
try {
98-
const dcdVersionString = await getLatestDcdVersion();
99-
100102
const {
101103
additionalAppBinaryIds,
102104
additionalAppFiles,
@@ -128,8 +130,11 @@ const run = async (): Promise<void> => {
128130
runnerType,
129131
debug,
130132
moropoV1ApiKey,
133+
useBeta,
131134
} = await getParameters();
132135

136+
const dcdVersionString = await getLatestDcdVersion(useBeta);
137+
133138
const params: Record<string, any> = {
134139
'additional-app-binary-ids': additionalAppBinaryIds,
135140
'additional-app-files': additionalAppFiles,

src/methods/params.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export type Params = {
3232
jsonFile?: boolean;
3333
debug?: boolean;
3434
moropoV1ApiKey?: string;
35+
useBeta?: boolean;
3536
};
3637

3738
function getAndroidApiLevel(apiLevel?: string): number | undefined {
@@ -181,6 +182,7 @@ export async function getParameters(): Promise<Params> {
181182
const moropoV1ApiKey = core.getInput('moropo-v1-api-key', {
182183
required: false,
183184
});
185+
const useBeta = core.getInput('use-beta', { required: false }) === 'true';
184186

185187
if (!(appFilePath !== '') !== (appBinaryId !== '')) {
186188
throw new Error('Either app-file or app-binary-id must be used');
@@ -225,5 +227,6 @@ export async function getParameters(): Promise<Params> {
225227
jsonFile,
226228
debug,
227229
moropoV1ApiKey,
230+
useBeta,
228231
};
229232
}

0 commit comments

Comments
 (0)