Skip to content

Commit 12be688

Browse files
committed
Release 1.3.13, force latest CLI version
1 parent d726a10 commit 12be688

File tree

2 files changed

+21
-3
lines changed

2 files changed

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

src/index.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { setFailed, setOutput } from '@actions/core';
22
import { getParameters } from './methods/params';
33
import { spawn } from 'child_process';
44

5-
const dcdVersionString = '@devicecloud.dev/dcd@>=3.7.4';
5+
const dcdPackageName = '@devicecloud.dev/dcd';
66

77
const escapeShellValue = (value: string): string => {
88
// Escape special characters that could cause shell interpretation issues
@@ -60,6 +60,7 @@ const executeCommand = (
6060
const getTestStatus = async (
6161
uploadId: string,
6262
apiKey: string,
63+
dcdVersionString: string,
6364
apiUrl?: string
6465
): Promise<StatusResponse | null> => {
6566
try {
@@ -77,8 +78,25 @@ const getTestStatus = async (
7778
}
7879
};
7980

81+
const getLatestDcdVersion = async (): Promise<string> => {
82+
try {
83+
const { output } = await executeCommand(
84+
`npm view ${dcdPackageName} version`,
85+
false
86+
);
87+
const version = output.trim();
88+
console.info(`Latest DCD version from npm: ${version}`);
89+
return `${dcdPackageName}@${version}`;
90+
} catch (error) {
91+
console.warn('Failed to fetch latest DCD version, falling back to >=4.0.3:', error);
92+
return `${dcdPackageName}@>=4.0.3`;
93+
}
94+
};
95+
8096
const run = async (): Promise<void> => {
8197
try {
98+
const dcdVersionString = await getLatestDcdVersion();
99+
82100
const {
83101
additionalAppBinaryIds,
84102
additionalAppFiles,
@@ -196,7 +214,7 @@ const run = async (): Promise<void> => {
196214
}
197215

198216
// Get the test status and results
199-
const result = await getTestStatus(uploadId, apiKey, apiUrl);
217+
const result = await getTestStatus(uploadId, apiKey, dcdVersionString, apiUrl);
200218

201219
if (result) {
202220
// Set outputs based on the status results

0 commit comments

Comments
 (0)