@@ -2216,7 +2216,7 @@ const Context = __importStar(__nccwpck_require__(8663));
22162216const Utils = __importStar(__nccwpck_require__(1365));
22172217// octokit + plugins
22182218const core_1 = __nccwpck_require__(6895);
2219- const plugin_rest_endpoint_methods_1 = __nccwpck_require__(9289 );
2219+ const plugin_rest_endpoint_methods_1 = __nccwpck_require__(6495 );
22202220const plugin_paginate_rest_1 = __nccwpck_require__(6212);
22212221exports.context = new Context.Context();
22222222const baseUrl = Utils.getApiBaseUrl();
@@ -41984,7 +41984,7 @@ const getLatestDcdVersion = (...args_1) => __awaiter(void 0, [...args_1], void 0
4198441984 }
4198541985});
4198641986const run = () => __awaiter(void 0, void 0, void 0, function* () {
41987- var _a;
41987+ var _a, _b ;
4198841988 try {
4198941989 const { androidApiLevel, androidDevice, apiKey, apiUrl, appBinaryId, appFilePath, async, config, deviceLocale, downloadArtifacts, env, excludeFlows, excludeTags, googlePlay, ignoreShaCheck, includeTags, iOSVersion, iosDevice, jsonFile, maestroVersion, name, orientation, report, retry, workspaceFolder, runnerType, debug, moropoV1ApiKey, useBeta, maestroChromeOnboarding, androidNoSnapshot, disableAnimations, githubContext, } = yield (0, params_1.getParameters)();
4199041990 const REMOVED_MAESTRO_VERSIONS = ['1.39.2', '1.39.7', '2.0.3'];
@@ -42057,7 +42057,7 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
4205742057 try {
4205842058 process.env.DCD_CI_WRAPPER_VERSION = (__nccwpck_require__(8330)/* .version */ .rE);
4205942059 }
42060- catch (_b ) {
42060+ catch (_c ) {
4206142061 // best-effort — version is optional
4206242062 }
4206342063 // Execute the test command and capture the upload ID
@@ -42077,6 +42077,21 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
4207742077 if (!uploadId) {
4207842078 throw new Error('Failed to get upload ID from console URL');
4207942079 }
42080+ // Async mode: the CLI has already submitted the run and exited (saving CI
42081+ // minutes). Do NOT poll for results — the DeviceCloud GitHub App reports the
42082+ // outcome as a "DeviceCloud" check on the commit/PR when the run completes.
42083+ // Just surface the upload id/console URL and exit successfully.
42084+ if (async) {
42085+ const consoleUrl = ((_b = testOutput === null || testOutput === void 0 ? void 0 : testOutput.match(/https:\/\/(?:dev\.)?console\.devicecloud\.dev\/results\?upload=[a-zA-Z0-9-]+/)) === null || _b === void 0 ? void 0 : _b[0]) || '';
42086+ (0, core_1.setOutput)('DEVICE_CLOUD_CONSOLE_URL', consoleUrl);
42087+ (0, core_1.setOutput)('DEVICE_CLOUD_UPLOAD_STATUS', 'PENDING');
42088+ (0, core_1.setOutput)('DEVICE_CLOUD_FLOW_RESULTS', '[]');
42089+ console.info('Async run submitted; not waiting for results.' +
42090+ (consoleUrl ? ` Track progress: ${consoleUrl}` : ''));
42091+ console.info('Install the DeviceCloud GitHub App to get a pass/fail check on this ' +
42092+ 'commit/PR when the run completes: https://docs.devicecloud.dev/ci-cd/github-actions');
42093+ return;
42094+ }
4208042095 // Get the test status and results
4208142096 const result = yield getTestStatus(uploadId, apiKey, dcdVersionString, apiUrl);
4208242097 if (result) {
@@ -42216,13 +42231,16 @@ function getInferredName() {
4221642231 return github.context.sha;
4221742232}
4221842233function getGithubContextMetadata() {
42219- var _a, _b, _c;
42234+ var _a, _b, _c, _d, _e ;
4222042235 const ctx = github.context;
4222142236 const pr = ctx.payload.pull_request;
4222242237 const rawRef = (_b = (_a = pr === null || pr === void 0 ? void 0 : pr.head) === null || _a === void 0 ? void 0 : _a.ref) !== null && _b !== void 0 ? _b : ctx.ref;
4222342238 const branch = (_c = rawRef === null || rawRef === void 0 ? void 0 : rawRef.replace(/^refs\/heads\//, '')) !== null && _c !== void 0 ? _c : '';
42239+ // On pull_request events ctx.sha is a throwaway *merge* commit; a GitHub
42240+ // check (and the developer-visible commit) must use the PR's head sha.
42241+ const headSha = (_e = (_d = pr === null || pr === void 0 ? void 0 : pr.head) === null || _d === void 0 ? void 0 : _d.sha) !== null && _e !== void 0 ? _e : ctx.sha;
4222442242 const pairs = [
42225- `gh_sha=${ctx.sha }`,
42243+ `gh_sha=${headSha }`,
4222642244 `gh_run_id=${ctx.runId}`,
4222742245 `gh_repo=${ctx.repo.owner}/${ctx.repo.repo}`,
4222842246 ];
@@ -44502,7 +44520,7 @@ paginateRest.VERSION = VERSION;
4450244520
4450344521/***/ }),
4450444522
44505- /***/ 9289 :
44523+ /***/ 6495 :
4450644524/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
4450744525
4450844526"use strict";
@@ -44515,12 +44533,12 @@ __nccwpck_require__.d(__webpack_exports__, {
4451544533 restEndpointMethods: () => (/* binding */ restEndpointMethods)
4451644534});
4451744535
44518- ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6 /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
44536+ ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
4451944537const VERSION = "17.0.0";
4452044538
4452144539//# sourceMappingURL=version.js.map
4452244540
44523- ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6 /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
44541+ ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
4452444542const Endpoints = {
4452544543 actions: {
4452644544 addCustomLabelsToSelfHostedRunnerForOrg: [
@@ -46814,7 +46832,7 @@ var endpoints_default = Endpoints;
4681446832
4681546833//# sourceMappingURL=endpoints.js.map
4681646834
46817- ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6 /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
46835+ ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js
4681846836
4681946837const endpointMethodsMap = /* @__PURE__ */ new Map();
4682046838for (const [scope, endpoints] of Object.entries(endpoints_default)) {
@@ -46940,7 +46958,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) {
4694046958
4694146959//# sourceMappingURL=endpoints-to-methods.js.map
4694246960
46943- ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoint-methods@17.0.0_@octokit+core@7.0.6 /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
46961+ ;// CONCATENATED MODULE: ./node_modules/.pnpm/@octokit+plugin-rest-endpoi_88f1cfdccbcd12f9bd89a662a3d08bce /node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js
4694446962
4694546963
4694646964function restEndpointMethods(octokit) {
0 commit comments