-
Notifications
You must be signed in to change notification settings - Fork 168
Prototype - Create PRs directly from Markdoc Sandbox #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request introduces 1 alert when merging 178ddba into cc14365 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 81135de into cc14365 - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matv-stripe ik this is WIP, so FFT ignore, but just wanted to share a couple suggestions.
|
||
const body = JSON.stringify({ files }); | ||
|
||
const response = await fetch('/api/create-pr', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should just call this:
const response = await fetch('/api/create-pr', { | |
const response = await fetch('/api/pr', { |
and POST
to it.
<button | ||
className="create-pr-btn" | ||
onClick={async () => { | ||
// TODO: oauth is so annoying. We have to auth this and then get the code back, pass that to the server, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this comment more straight to the point?
} | ||
} | ||
}, | ||
"lockfileVersion": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to keep this version at 2
const initGithubClient = (token) => { | ||
const octokit = new MyOctokit({ | ||
auth: TOKEN | ||
}); | ||
|
||
return octokit; | ||
}; | ||
|
||
const octokit = initGithubClient(TOKEN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const initGithubClient = (token) => { | |
const octokit = new MyOctokit({ | |
auth: TOKEN | |
}); | |
return octokit; | |
}; | |
const octokit = initGithubClient(TOKEN); | |
const octokit = new MyOctokit({auth: TOKEN}); |
Yeah sorry @mfix-stripe , hacky WIP prototype. I think there is actually value in actually shipping this - would be a very cool contributor experience to be able to edit directly. But, could not get the o auth piece working well in an 30 minute time box. Closing the PR for now and will save it for another time. |
For fun
You have to create a github token - https://github.com/settings/tokens/new?scopes=repo and then you can run
GITHUB_AUTO_PR_TOKEN=ghp_yourtokenhere npm run dev
auto.create.PRs.mov
Would be better if "create pr" opened up the github flow