Skip to content

Commit

Permalink
remove octokit
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed May 18, 2024
1 parent 5a759f8 commit 2484337
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 464 deletions.
9 changes: 9 additions & 0 deletions build/github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function getLatestRelease({owner, repo}) {
const res = await fetch(`https://api.github.com/repos/${owner}/${repo}/releases/latest`, {
headers: {
'Accept': 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
}
});
return await res.json();
}
6 changes: 2 additions & 4 deletions build/publish.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Octokit } from 'octokit';
import path from 'path';
import fs from 'fs';

import {execute} from './execute.js';

const octokit = new Octokit({ });
import * as github from './github.js';

const owner = 'greggman';
const repo = 'tintd-bundler';
Expand All @@ -25,7 +23,7 @@ async function downloadFile(name, url, filepath) {
}

async function main() {
const latest = await octokit.rest.repos.getLatestRelease({
const latest = await github.getLatestRelease({
owner,
repo,
});
Expand Down
Loading

0 comments on commit 2484337

Please sign in to comment.