Skip to content

Instantly share code, notes, and snippets.

@Jolg42
Last active October 20, 2021 13:12
Show Gist options
  • Save Jolg42/4fa6f7732bd22513c49ef868e246a71a to your computer and use it in GitHub Desktop.
Save Jolg42/4fa6f7732bd22513c49ef868e246a71a to your computer and use it in GitHub Desktop.
Prisma Milestones
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
const token = Deno.env.get("GITHUB_TOKEN")
const octokit = new Octokit({ auth: token});
const repos = await octokit.request('GET /user/repos');
const milestones = [{
"title": "3.4.0",
// "description": ""
"due_on": "2021-11-02T00:00:00Z"
}];
console.log(repos)
// for (let r=0; r < repos.length; r++) {
// let repo = repos[r];
// for (let m=0; m < milestones.length; m++) {
// let milestone = milestones[m];
// let payload = {
// owner: repo.owner.login,
// repo: repo.name,
// title: milestone.title,
// description: milestone.description,
// due_on: milestone.due_on
// };
// await octokit.request(`POST /repos/{owner}/{repo}/milestones`, payload);
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment