sadasant / testGithubApp

Awesome Concept for a Github App

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[IDEA] Link to auto-format your PR

sadasant opened this issue · comments

If your PR has a fmt script in the package.json, we could provide a link in the output of this app, on the pull request description, allowing users to click and auto-format their PR. I'm thinking that it will require creating an endpoint with PRobot, then adding the link to the App's output, then having this endpoint fork the repo (either locally or in S3), checkout to the branch of the PR, install the dependencies, run npm run fmt, then push to the related PR.

I found some resources! Thanks to the feedback I received in PRobot's official Slack 😄(specifically Bex Warner 🎉).

Resources:

I'm not sure i'm following 100% here but would you want the changes to applied to an existing pull request or have the bot open up follow up PRs? because you can get all the changes from a PR and the whole contents of the repo via https://octokit.github.io/rest.js/#api-Repos-getContent and then use that to have your bot add a commit to a PR.