diff --git a/dist/main/index.js b/dist/main/index.js index 31ea153..89f9f52 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -6787,13 +6787,21 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume function run() { return __awaiter(this, void 0, void 0, function* () { try { - yield installNsc(); - yield ensureFreshTenantToken(); - const registry = yield dockerLogin(); - _actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("registry-address", registry); + yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Install Namespace Cloud CLI`, () => __awaiter(this, void 0, void 0, function* () { + yield installNsc(); + yield _actions_exec__WEBPACK_IMPORTED_MODULE_2__.exec("nsc version"); + })); + const registry = yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Log into Namespace workspace`, () => __awaiter(this, void 0, void 0, function* () { + yield ensureFreshTenantToken(); + return yield dockerLogin(); + })); + yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Registry address`, () => __awaiter(this, void 0, void 0, function* () { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.info(registry); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("registry-address", registry); + })); } - catch (error) { - _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message); + catch (e) { + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(e.message); } }); } @@ -6845,7 +6853,7 @@ function ensureFreshTenantToken() { function dockerLogin() { return __awaiter(this, void 0, void 0, function* () { const out = tmpFile("registry.txt"); - yield _actions_exec__WEBPACK_IMPORTED_MODULE_2__.exec(`nsc cluster docker-login --output_registry_to=${out}`); + yield _actions_exec__WEBPACK_IMPORTED_MODULE_2__.exec(`nsc cluster docker-login --output_registry_to=${out} --log_actions=false`); return fs__WEBPACK_IMPORTED_MODULE_3__.readFileSync(out, "utf8"); }); } diff --git a/main.ts b/main.ts index 3235b4c..02a9e6d 100644 --- a/main.ts +++ b/main.ts @@ -6,14 +6,22 @@ import * as path from "path"; async function run(): Promise { try { - await installNsc(); - - await ensureFreshTenantToken(); - - const registry = await dockerLogin(); - core.setOutput("registry-address", registry); - } catch (error) { - core.setFailed(error.message); + await core.group(`Install Namespace Cloud CLI`, async () => { + await installNsc(); + await exec.exec("nsc version"); + }); + + const registry = await core.group(`Log into Namespace workspace`, async () => { + await ensureFreshTenantToken(); + return await dockerLogin(); + }); + + await core.group(`Registry address`, async () => { + core.info(registry); + core.setOutput("registry-address", registry); + }); + } catch (e) { + core.setFailed(e.message); } } @@ -69,7 +77,7 @@ async function ensureFreshTenantToken() { async function dockerLogin() { const out = tmpFile("registry.txt"); - await exec.exec(`nsc cluster docker-login --output_registry_to=${out}`); + await exec.exec(`nsc cluster docker-login --output_registry_to=${out} --log_actions=false`); return fs.readFileSync(out, "utf8"); }