Skip to content

Commit

Permalink
try with more null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichelo committed Jan 26, 2024
1 parent ab11608 commit ad5725e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7103,12 +7103,11 @@ function run() {
const registry = 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];
if (isDockerLogin == null || isDockerLogin != "1") {
return yield dockerLogin();
}
const reg = process.env[Env_DockerRegistry];
_actions_core__WEBPACK_IMPORTED_MODULE_0__.info(`Already logged in to Namespace Private Container Registry: ${reg}.`);
return reg;
if (isDockerLogin != null && reg != null && isDockerLogin == "1" && reg != "") {
return reg;
}
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);
Expand Down
9 changes: 4 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ async function run(): Promise<void> {
const registry = await core.group(`Log into Namespace workspace`, async () => {
await ensureNscloudToken();
const isDockerLogin = process.env[Env_DockerLogin];
if (isDockerLogin == null || isDockerLogin != "1") {
return await dockerLogin();
const reg = process.env[Env_DockerRegistry];
if (isDockerLogin != null && reg != null && isDockerLogin == "1" && reg != "") {
return reg;
}

const reg = process.env[Env_DockerRegistry];
core.info(`Already logged in to Namespace Private Container Registry: ${reg}.`);
return reg;
return await dockerLogin();
});

await core.group(`Registry address`, async () => {
Expand Down

0 comments on commit ad5725e

Please sign in to comment.