Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
This val provides a (very) thin wrapper around the GH rest API methods for creating a pull request. It handles the creation of a Octokit client for you.
import { submitPR } from "https://esm.town/v/nbbaier/submitPR";
await submitPR(Deno.env.get("GH_REPO_TOKEN"), {
owner: "nbbaier",
repo: "test-ground",
head: "branch_2",
base: "main",
title: "trying another PR",
body: "cool stuff, take a look",
});
The function takes two parameters: your gh access token and an object that's identical to the object submitted to the gh API. See GH's documentation for more info!