Github tana-paste example

This lets you run the script when you are viewing a pull request to prefill some metadata around the pr to paste into Tana

Open tana-github in Script Kit

// Name: tana-github
import "@johnlindquist/kit";
const { Octokit } = await npm("octokit");
const UrlPattern = await npm("url-pattern");
const client = new Octokit({
auth: await env("GITHUB_PULLREQUEST_TOKEN"),
const repoPattern = new UrlPattern(
const tab = await getActiveTab("Brave");
const { owner, repo, id } = repoPattern.match(tab);
const res = await{
pull_number: id,
const { title, user, html_url } =;
await copy(`%%tana%%
- ${title} #pull request
- Pull Request URL:: ${html_url}
- Github User:: ${user.login}