Created
March 28, 2025 18:44
-
-
Save lehmacdj/665fa643df39dc9faae32b1ef1bebf7b to your computer and use it in GitHub Desktop.
Duolingo Github to Graphite Redirect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Github PR to Graphite Redirect | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Redirect GitHub PR pages to Graphite equivalents | |
// @match https://github.com/duolingo/*/pull/* | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
const githubUrl = window.location.href; | |
// Match pattern: https://github.com/{owner}/{repo}/pull/{number} | |
const match = githubUrl.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/); | |
if (match) { | |
const [, owner, repo, prNumber] = match; | |
if (owner != "duolingo") { | |
return; | |
} | |
const graphiteUrl = `https://app.graphite.dev/github/pr/${owner}/${repo}/${prNumber}`; | |
window.location.replace(graphiteUrl); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment