Skip to content

Commit

Permalink
build with yarn and add back the env checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichelo committed Jan 27, 2024
1 parent 151a4b5 commit f2b652c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
14 changes: 8 additions & 6 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7116,8 +7116,6 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume



const Env_DockerLogin = "NSC_DOCKER_LOGIN";
const Env_DockerRegistry = "NSC_CONTAINER_REGISTRY";
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
Expand All @@ -7135,10 +7133,14 @@ function run() {
yield _actions_core__WEBPACK_IMPORTED_MODULE_0__.group(`Log into Namespace workspace`, () => __awaiter(this, void 0, void 0, function* () {
yield ensureNscloudToken();
}));
const 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();
}));
const { NSC_DOCKER_LOGIN, NSC_CONTAINER_REGISTRY } = process.env;
let registry = NSC_CONTAINER_REGISTRY;
if (NSC_DOCKER_LOGIN == null || registry == null || NSC_DOCKER_LOGIN != "1" || registry == "") {
const 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
15 changes: 8 additions & 7 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import * as exec from "@actions/exec";
import * as fs from "fs";
import * as path from "path";

const Env_DockerLogin = "NSC_DOCKER_LOGIN"
const Env_DockerRegistry = "NSC_CONTAINER_REGISTRY"

async function run(): Promise<void> {
try {
const which = require("which");
Expand All @@ -25,10 +22,14 @@ async function run(): Promise<void> {
await ensureNscloudToken();
});

const registry = await core.group(`Log into Namespace workspace container registry`, async () => {
await ensureNscloudToken();
return await dockerLogin();
});
const { NSC_DOCKER_LOGIN, NSC_CONTAINER_REGISTRY } = process.env;
let registry = NSC_CONTAINER_REGISTRY;
if (NSC_DOCKER_LOGIN == null || registry == null || NSC_DOCKER_LOGIN != "1" || registry == "") {
const 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);
Expand Down

0 comments on commit f2b652c

Please sign in to comment.