Skip to content

Conversation

matv-stripe
Copy link
Contributor

@matv-stripe matv-stripe commented Jul 13, 2022

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

@vercel
Copy link

vercel bot commented Jul 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
markdoc ❌ Failed (Inspect) Jul 13, 2022 at 10:13PM (UTC)
markdoc-simple-nextjs ✅ Ready (Inspect) Visit Preview Jul 13, 2022 at 10:13PM (UTC)

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jul 13, 2022

This pull request introduces 1 alert when merging 178ddba into cc14365 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jul 13, 2022

This pull request introduces 2 alerts when merging 81135de into cc14365 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

Copy link
Contributor

@mfix-stripe mfix-stripe left a 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', {
Copy link
Contributor

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:

Suggested change
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
Copy link
Contributor

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,
Copy link
Contributor

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

Comment on lines +11 to +19
const initGithubClient = (token) => {
const octokit = new MyOctokit({
auth: TOKEN
});

return octokit;
};

const octokit = initGithubClient(TOKEN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const initGithubClient = (token) => {
const octokit = new MyOctokit({
auth: TOKEN
});
return octokit;
};
const octokit = initGithubClient(TOKEN);
const octokit = new MyOctokit({auth: TOKEN});

@matv-stripe
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants