Skip to content

Commit 592aafe

Browse files
committed
feat: update github action
1 parent d06a65a commit 592aafe

File tree

9 files changed

+34
-40
lines changed

9 files changed

+34
-40
lines changed

dist/action.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3232
});
3333
};
3434
Object.defineProperty(exports, "__esModule", { value: true });
35-
exports.buildClient = exports.action = void 0;
35+
exports.buildClient = void 0;
36+
exports.action = action;
3637
const core = __importStar(require("@actions/core"));
3738
const github = __importStar(require("@actions/github"));
3839
const asana_action_1 = require("./asana/asana-action");
@@ -246,4 +247,3 @@ function action() {
246247
}
247248
});
248249
}
249-
exports.action = action;

dist/asana/asana-action.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3232
});
3333
};
3434
Object.defineProperty(exports, "__esModule", { value: true });
35-
exports.updateTask = exports.updateSection = exports.moveSection = exports.migrateSection = exports.findComment = exports.buildClient = exports.addComment = void 0;
35+
exports.addComment = addComment;
36+
exports.buildClient = buildClient;
37+
exports.findComment = findComment;
38+
exports.migrateSection = migrateSection;
39+
exports.moveSection = moveSection;
40+
exports.updateSection = updateSection;
41+
exports.updateTask = updateTask;
3642
const core = __importStar(require("@actions/core"));
3743
const asana = __importStar(require("asana"));
3844
// types not working asana
@@ -57,7 +63,6 @@ function moveSection(client, taskId, targets) {
5763
}
5864
});
5965
}
60-
exports.moveSection = moveSection;
6166
function updateTask(client, taskId, targets) {
6267
return __awaiter(this, void 0, void 0, function* () {
6368
const task = yield client.tasks.findById(taskId);
@@ -75,7 +80,6 @@ function updateTask(client, taskId, targets) {
7580
}
7681
});
7782
}
78-
exports.updateTask = updateTask;
7983
function updateSection(client, targets) {
8084
return __awaiter(this, void 0, void 0, function* () {
8185
for (const target of targets) {
@@ -110,7 +114,6 @@ function updateSection(client, targets) {
110114
}
111115
});
112116
}
113-
exports.updateSection = updateSection;
114117
function migrateSection(client, targets) {
115118
return __awaiter(this, void 0, void 0, function* () {
116119
for (const target of targets) {
@@ -137,7 +140,6 @@ function migrateSection(client, targets) {
137140
}
138141
});
139142
}
140-
exports.migrateSection = migrateSection;
141143
function findComment(client, taskId, commentId) {
142144
return __awaiter(this, void 0, void 0, function* () {
143145
let stories;
@@ -152,7 +154,6 @@ function findComment(client, taskId, commentId) {
152154
return stories.find((story) => story.text.indexOf(commentId) !== -1);
153155
});
154156
}
155-
exports.findComment = findComment;
156157
function addComment(client, taskId, commentId, text, isPinned) {
157158
return __awaiter(this, void 0, void 0, function* () {
158159
if (commentId) {
@@ -171,7 +172,6 @@ function addComment(client, taskId, commentId, text, isPinned) {
171172
}
172173
});
173174
}
174-
exports.addComment = addComment;
175175
function buildClient(asanaPAT) {
176176
return __awaiter(this, void 0, void 0, function* () {
177177
return asana.Client.create({
@@ -183,4 +183,3 @@ function buildClient(asanaPAT) {
183183
.authorize();
184184
});
185185
}
186-
exports.buildClient = buildClient;

dist/shopify/check-theme.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
99
});
1010
};
1111
Object.defineProperty(exports, "__esModule", { value: true });
12-
exports.checkTheme = void 0;
12+
exports.checkTheme = checkTheme;
1313
const exec_1 = require("@actions/exec");
14-
function checkTheme(root, shopifyExecutable = "shopify", devPreview = true, flags = "") {
15-
return __awaiter(this, void 0, void 0, function* () {
14+
function checkTheme(root_1) {
15+
return __awaiter(this, arguments, void 0, function* (root, shopifyExecutable = "shopify", devPreview = true, flags = "") {
1616
const { exitCode, stdout, stderr } = yield (0, exec_1.getExecOutput)(shopifyExecutable, [
1717
"theme",
1818
"check",
@@ -31,4 +31,3 @@ function checkTheme(root, shopifyExecutable = "shopify", devPreview = true, flag
3131
};
3232
});
3333
}
34-
exports.checkTheme = checkTheme;

dist/shopify/delete-theme.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1212
return (mod && mod.__esModule) ? mod : { "default": mod };
1313
};
1414
Object.defineProperty(exports, "__esModule", { value: true });
15-
exports.deleteTheme = void 0;
15+
exports.deleteTheme = deleteTheme;
1616
const node_fetch_1 = __importDefault(require("node-fetch"));
1717
const get_theme_1 = require("./get-theme");
1818
function deleteTheme(themeName, shopifyAuth) {
@@ -39,4 +39,3 @@ function deleteTheme(themeName, shopifyAuth) {
3939
return data;
4040
});
4141
}
42-
exports.deleteTheme = deleteTheme;

dist/shopify/deploy-theme.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
99
});
1010
};
1111
Object.defineProperty(exports, "__esModule", { value: true });
12-
exports.deployTheme = void 0;
12+
exports.deployTheme = deployTheme;
1313
const exec_1 = require("@actions/exec");
1414
/**
1515
* Deploy a Shopify theme to the specified store.
@@ -22,13 +22,13 @@ const exec_1 = require("@actions/exec");
2222
* @param flags Additional flags as a single string, will be split into an array.
2323
* @returns A promise resolving to an object with the exit code and parsed JSON output from the command.
2424
*/
25-
function deployTheme(root, shopifyExecutable = "shopify", themeName, password, store, devPreview = false, flags = "") {
26-
return __awaiter(this, void 0, void 0, function* () {
25+
function deployTheme(root_1) {
26+
return __awaiter(this, arguments, void 0, function* (root, shopifyExecutable = "shopify", themeName, password, store, devPreview = false, flags = "") {
2727
const commandArgs = [
2828
"theme",
2929
"push",
3030
devPreview ? "--development" : undefined,
31-
"--json",
31+
"--json", // Ensures JSON output for parsing
3232
...flags.split(" "),
3333
"--path",
3434
root,
@@ -53,4 +53,3 @@ function deployTheme(root, shopifyExecutable = "shopify", themeName, password, s
5353
};
5454
});
5555
}
56-
exports.deployTheme = deployTheme;

dist/shopify/install-cli.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1212
return (mod && mod.__esModule) ? mod : { "default": mod };
1313
};
1414
Object.defineProperty(exports, "__esModule", { value: true });
15-
exports.installCli = void 0;
15+
exports.installCli = installCli;
1616
const exec_1 = require("@actions/exec");
1717
const semver_1 = __importDefault(require("semver"));
1818
const MIN_VERSION = "3.50.0";
@@ -32,7 +32,6 @@ function installCli(version) {
3232
].filter(Boolean));
3333
});
3434
}
35-
exports.installCli = installCli;
3635
function shouldIncludeTheme(version) {
3736
if (!version || version.includes("experimental")) {
3837
return false;

dist/shopify/shopify.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
99
});
1010
};
1111
Object.defineProperty(exports, "__esModule", { value: true });
12-
exports.removeTheme = exports.updateTheme = exports.runCheckTheme = exports.createTheme = void 0;
12+
exports.createTheme = createTheme;
13+
exports.runCheckTheme = runCheckTheme;
14+
exports.updateTheme = updateTheme;
15+
exports.removeTheme = removeTheme;
1316
const check_theme_1 = require("./check-theme");
1417
const delete_theme_1 = require("./delete-theme");
1518
const deploy_theme_1 = require("./deploy-theme");
@@ -34,7 +37,6 @@ function createTheme(shopifyAuth) {
3437
}
3538
});
3639
}
37-
exports.createTheme = createTheme;
3840
// Function to check theme
3941
function runCheckTheme() {
4042
return __awaiter(this, void 0, void 0, function* () {
@@ -48,7 +50,6 @@ function runCheckTheme() {
4850
}
4951
});
5052
}
51-
exports.runCheckTheme = runCheckTheme;
5253
// Function to update an existing theme
5354
function updateTheme(shopifyAuth) {
5455
return __awaiter(this, void 0, void 0, function* () {
@@ -65,7 +66,6 @@ function updateTheme(shopifyAuth) {
6566
}
6667
});
6768
}
68-
exports.updateTheme = updateTheme;
6969
// Function to remove a theme
7070
function removeTheme(shopifyAuth) {
7171
return __awaiter(this, void 0, void 0, function* () {
@@ -80,4 +80,3 @@ function removeTheme(shopifyAuth) {
8080
}
8181
});
8282
}
83-
exports.removeTheme = removeTheme;

dist/vercel/get-vercel-preview-url.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,21 @@ const getVercelPreviewURL = (githubContext, octokit) => __awaiter(void 0, void 0
2727
const vercelComment = comments.find((comment) => {
2828
var _a, _b;
2929
return ((_a = comment.user) === null || _a === void 0 ? void 0 : _a.login) === "vercel[bot]" &&
30-
((_b = comment.body) === null || _b === void 0 ? void 0 : _b.includes("via=pr-comment-visit-preview-link&passThrough=1"));
30+
((_b = comment.body) === null || _b === void 0 ? void 0 : _b.includes("nextjs-commerce-git"));
3131
});
3232
if (!vercelComment) {
3333
console.info("No Vercel preview comment found.");
3434
return null;
3535
}
36-
const vercelPreviewUrlMatch = (_b = vercelComment.body) === null || _b === void 0 ? void 0 : _b.match(/https:\/\/vercel\.live\/open-feedback\/[^?\s]+\?via=pr-comment-visit-preview-link&passThrough=1/);
36+
const vercelPreviewUrlMatch = (_b = vercelComment.body) === null || _b === void 0 ? void 0 : _b.match(/https:\/\/nextjs-commerce-git[^?\s]+\.vercel\.app/);
3737
if (!vercelPreviewUrlMatch) {
3838
console.info("No Vercel preview URL found in the comment.");
3939
return null;
4040
}
41-
const cleanVercelPreviewUrl = `https://${vercelPreviewUrlMatch[0].split("open-feedback/")[1].split("?")[0]}`;
42-
return cleanVercelPreviewUrl;
41+
// const cleanVercelPreviewUrl = `https://${
42+
// vercelPreviewUrlMatch[0].split("open-feedback/")[1].split("?")[0]
43+
// }`;
44+
return vercelPreviewUrlMatch[0];
4345
}
4446
catch (error) {
4547
console.error("Error fetching Vercel preview URL:", error);

src/vercel/get-vercel-preview-url.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ export const getVercelPreviewURL = async (
2525
const vercelComment = comments.find(
2626
(comment) =>
2727
comment.user?.login === "vercel[bot]" &&
28-
comment.body?.includes(
29-
"via=pr-comment-visit-preview-link&passThrough=1"
30-
)
28+
comment.body?.includes("nextjs-commerce-git")
3129
);
3230

3331
if (!vercelComment) {
@@ -36,19 +34,19 @@ export const getVercelPreviewURL = async (
3634
}
3735

3836
const vercelPreviewUrlMatch = vercelComment.body?.match(
39-
/https:\/\/vercel\.live\/open-feedback\/[^?\s]+\?via=pr-comment-visit-preview-link&passThrough=1/
37+
/https:\/\/nextjs-commerce-git[^?\s]+\.vercel\.app/
4038
);
4139

4240
if (!vercelPreviewUrlMatch) {
4341
console.info("No Vercel preview URL found in the comment.");
4442
return null;
4543
}
4644

47-
const cleanVercelPreviewUrl = `https://${
48-
vercelPreviewUrlMatch[0].split("open-feedback/")[1].split("?")[0]
49-
}`;
45+
// const cleanVercelPreviewUrl = `https://${
46+
// vercelPreviewUrlMatch[0].split("open-feedback/")[1].split("?")[0]
47+
// }`;
5048

51-
return cleanVercelPreviewUrl;
49+
return vercelPreviewUrlMatch[0];
5250
} catch (error) {
5351
console.error("Error fetching Vercel preview URL:", error);
5452
return null;

0 commit comments

Comments
 (0)