Skip to content

Commit

Permalink
try with separate core group
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichelo committed Jan 26, 2024
1 parent ad5725e commit 4131560
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
16 changes: 9 additions & 7 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7100,15 +7100,17 @@ function run() {
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`Namespace Cloud CLI found.`);
}
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 _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Log into Namespace workspace`, () => __awaiter(this, void 0, void 0, function* () {
yield ensureNscloudToken();
const isDockerLogin = process.env[Env_DockerLogin];
const reg = process.env[Env_DockerRegistry];
if (isDockerLogin != null && reg != null && isDockerLogin == "1" && reg != "") {
return reg;
}
return yield dockerLogin();
}));
const isDockerLogin = process.env[Env_DockerLogin];
let registry = process.env[Env_DockerRegistry];
if (isDockerLogin == null || registry == null || isDockerLogin != "1" || registry == "") {
registry = yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Log into Namespace workspace container registry`, () => __awaiter(this, void 0, void 0, function* () {
yield ensureNscloudToken();
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);
Expand Down
18 changes: 10 additions & 8 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ async function run(): Promise<void> {
}
await exec.exec("nsc version");

const registry = await core.group(`Log into Namespace workspace`, async () => {
await core.group(`Log into Namespace workspace`, async () => {
await ensureNscloudToken();
const isDockerLogin = process.env[Env_DockerLogin];
const reg = process.env[Env_DockerRegistry];
if (isDockerLogin != null && reg != null && isDockerLogin == "1" && reg != "") {
return reg;
}

return await dockerLogin();
});

const isDockerLogin = process.env[Env_DockerLogin];
let registry = process.env[Env_DockerRegistry];
if (isDockerLogin == null || registry == null || isDockerLogin != "1" || registry == "") {
registry = await core.group(`Log into Namespace workspace container registry`, async () => {
await ensureNscloudToken();
return await dockerLogin();
});
}

await core.group(`Registry address`, async () => {
core.info(registry);
core.setOutput("registry-address", registry);
Expand Down

0 comments on commit 4131560

Please sign in to comment.