swinton/github-rest-apis-for-insomnia

🦄 Auto-updating

gr2m opened this issue · 1 comments

gr2m commented

Here is what I would do

  1. When running node ./index.js it currently logs the result to stdout. I would suggest to update routes/api.github.com/github-rest-apis-for-insomnia.json directly, using fs.writeFileSync()

  2. Install Greenkeeper to get automatic pull requests for dependency updates, as defined in package.json

  3. In your package.json, pin the version of @octokit/routes, so that Greenkeeper will send a pull request for every update, not only for major versions.

    - "@octokit/routes": "^18.6.2",
    + "@octokit/routes": "18.6.2",
  4. Use a GitHub action that runs node ./index.js on push, but only when branch name starts with ^greenkeeper/@octokit/routes.

  5. Commit the changes

    git commit routes -m "build: routes"
    
  6. Push changes to Greenkeeper’s pull request. I’m not sure what the command will exactly look like for GitHub actions, here is what I do from Travis for reference: https://github.com/octokit/rest.js/blob/fc4f087246c57b20a2e5040a766a417913023acc/.travis.yml#L100

Let me know if that helps :)

If you like, you could also directly merge the pull request from the action, but I for one like to review these pull requests, just in case.

Thanks for the suggestions, @gr2m. These are great! ✨