Skip to content

Commit

Permalink
attempt Fix touchup.js [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 13, 2024
1 parent 22ab628 commit ad18a71
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions lib/nextjs-themes/touchup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,37 @@ const path = require("node:path");

const packageJson = require(path.resolve(process.cwd(), "package.json"));
if (process.env.TOKEN) {
const { Octokit } = import("octokit");
// Octokit.js
// https://github.com/octokit/core.js#readme
const octokit = new Octokit({
auth: process.env.TOKEN,
});
(async () => {
const { Octokit } = await import("octokit");
// Octokit.js
// https://github.com/octokit/core.js#readme
const octokit = new Octokit({
auth: process.env.TOKEN,
});

const octoOptions = {
owner: process.env.OWNER,
repo: process.env.REPO,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
};
const tagName = `v${packageJson.version}`;
const name = `Release ${tagName}`;
/** Create a release */
octokit.request("POST /repos/{owner}/{repo}/releases", {
...octoOptions,
tag_name: tagName,
target_commitish: "main",
name,
draft: false,
prerelease: false,
generate_release_notes: true,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
});
const octoOptions = {
owner: process.env.OWNER,
repo: process.env.REPO,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
};
const tagName = `v${packageJson.version}`;
const name = `Release ${tagName}`;
/** Create a release */
octokit.request("POST /repos/{owner}/{repo}/releases", {
...octoOptions,
tag_name: tagName,
target_commitish: "main",
name,
draft: false,
prerelease: false,
generate_release_notes: true,
headers: {
"X-GitHub-Api-Version": "2022-11-28",
},
});
})();
}
delete packageJson.scripts;

Expand Down

0 comments on commit ad18a71

Please sign in to comment.