{"action":"created","comment":{"url":"https://api.github.com/repos/octokit/routes/pulls/comments/217813090","pull_request_review_id":155623910,"id":217813090,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzgxMzA5MA==","diff_hunk":"@@ -1,5 +1,7 @@\n module.exports = checkOrUpdateRoutes\n \n+require('dotenv').config()","path":"lib/check-or-update-routes.js","position":3,"original_position":3,"commit_id":"0ee17adeefded605cf3f6412f6f3676eebe46220","original_commit_id":"c54e0b4787bf947829908e7f4fbf67c3aa71e5ac","user":{"login":"swinton","id":27806,"node_id":"MDQ6VXNlcjI3ODA2","avatar_url":"https://avatars2.githubusercontent.com/u/27806?v=4","gravatar_id":"","url":"https://api.github.com/users/swinton","html_url":"https://github.com/swinton","followers_url":"https://api.github.com/users/swinton/followers","following_url":"https://api.github.com/users/swinton/following{/other_user}","gists_url":"https://api.github.com/users/swinton/gists{/gist_id}","starred_url":"https://api.github.com/users/swinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swinton/subscriptions","organizations_url":"https://api.github.com/users/swinton/orgs","repos_url":"https://api.github.com/users/swinton/repos","events_url":"https://api.github.com/users/swinton/events{/privacy}","received_events_url":"https://api.github.com/users/swinton/received_events","type":"User","site_admin":true},"body":">  I wonder if we could run this as part of our travis cron job?\r\n\r\nI like this, but we'd need to establish a directory structure that would allow multiple versions of [`routes/routes`](https://github.com/octokit/routes/tree/master/routes).\r\n\r\nMaybe something like the below?\r\n\r\n```\r\n.\r\n├── enterprise-2.11.json\r\n├── enterprise-2.12.json\r\n├── enterprise-2.13.json\r\n├── enterprise-2.14.json\r\n├── index.json\r\n└── routes\r\n    ├── ALL-DOTCOM-ROUTES-LIVE-HERE\r\n    └── enterprise\r\n        ├── 2.11\r\n        │   └── ALL-GHE2.11-ROUTES-LIVE-HERE\r\n        ├── 2.12\r\n        │   └── ALL-GHE2.12-ROUTES-LIVE-HERE\r\n        ├── 2.13\r\n        │   └── ALL-GHE2.13-ROUTES-LIVE-HERE\r\n        └── 2.14\r\n            └── ALL-GHE2.14-ROUTES-LIVE-HERE\r\n\r\n```\r\n\r\n> we should handle all the environment variables / CLI arguments with yargs in bin/octokit-rest-routes.js\r\n\r\nSo, we could potentially have a new command line argument, `--enterprise`, which when set to a GHE version, will _do the right thing_ for that environment, setting up the `BASE_URL` and `PATH_PREFIX` as needed.\r\n\r\nSo, in `.travis.yml` we might have something like:\r\n\r\n```yaml\r\n# ...\r\n      script:\r\n        - rm -rf index.json routes\r\n        - bin/octokit-rest-routes.js update  # updates \"dotcom\" routes\r\n        - rm -rf enterprise/2.11/index.json enterprise/2.11/routes\r\n        - bin/octokit-rest-routes.js update --enterprise=2.11\r\n        - rm -rf enterprise/2.12/index.json enterprise/2.12/routes\r\n        - bin/octokit-rest-routes.js update --enterprise=2.12\r\n        - rm -rf enterprise/2.13/index.json enterprise/2.13/routes\r\n        - bin/octokit-rest-routes.js update --enterprise=2.13\r\n        - rm -rf enterprise/2.14/index.json enterprise/2.14/routes\r\n        - bin/octokit-rest-routes.js update --enterprise=2.14\r\n# ...\r\n```\r\n\r\nThis would mean though, that every new GitHub Enterprise release would require an update to this `.travis.yml`, is that OK do you think?","created_at":"2018-09-14T19:03:34Z","updated_at":"2018-09-14T19:03:34Z","html_url":"https://github.com/octokit/routes/pull/264#discussion_r217813090","pull_request_url":"https://api.github.com/repos/octokit/routes/pulls/264","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/octokit/routes/pulls/comments/217813090"},"html":{"href":"https://github.com/octokit/routes/pull/264#discussion_r217813090"},"pull_request":{"href":"https://api.github.com/repos/octokit/routes/pulls/264"}},"in_reply_to_id":216760388},"pull_request":{"url":"https://api.github.com/repos/octokit/routes/pulls/264","id":213335078,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMzM1MDc4","html_url":"https://github.com/octokit/routes/pull/264","diff_url":"https://github.com/octokit/routes/pull/264.diff","patch_url":"https://github.com/octokit/routes/pull/264.patch","issue_url":"https://api.github.com/repos/octokit/routes/issues/264","number":264,"state":"open","locked":false,"title":"Allow routes to be generated for different API versions via environment","user":{"login":"swinton","id":27806,"node_id":"MDQ6VXNlcjI3ODA2","avatar_url":"https://avatars2.githubusercontent.com/u/27806?v=4","gravatar_id":"","url":"https://api.github.com/users/swinton","html_url":"https://github.com/swinton","followers_url":"https://api.github.com/users/swinton/followers","following_url":"https://api.github.com/users/swinton/following{/other_user}","gists_url":"https://api.github.com/users/swinton/gists{/gist_id}","starred_url":"https://api.github.com/users/swinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swinton/subscriptions","organizations_url":"https://api.github.com/users/swinton/orgs","repos_url":"https://api.github.com/users/swinton/repos","events_url":"https://api.github.com/users/swinton/events{/privacy}","received_events_url":"https://api.github.com/users/swinton/received_events","type":"User","site_admin":true},"body":"Allows routes to be generated for different API versions via environment variables.\r\n\r\n## Example\r\nTo generate routes for [GitHub Enterprise 2.14](https://developer.github.com/enterprise/2.14/v3/) add the following environment variables:\r\n\r\n```bash\r\nBASE_URL=https://developer.github.com/enterprise/2.14/v3/\r\nPATH_PREFIX=/enterprise/2.14/v3/\r\n```\r\n\r\nFixes #254.\r\n","created_at":"2018-09-05T15:24:43Z","updated_at":"2018-09-14T19:03:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3631b8fd3be8ddb9b643f70c126c60318d07e8b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/octokit/routes/pulls/264/commits","review_comments_url":"https://api.github.com/repos/octokit/routes/pulls/264/comments","review_comment_url":"https://api.github.com/repos/octokit/routes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/octokit/routes/issues/264/comments","statuses_url":"https://api.github.com/repos/octokit/routes/statuses/0ee17adeefded605cf3f6412f6f3676eebe46220","head":{"label":"swinton:ghe-routes-generation","ref":"ghe-routes-generation","sha":"0ee17adeefded605cf3f6412f6f3676eebe46220","user":{"login":"swinton","id":27806,"node_id":"MDQ6VXNlcjI3ODA2","avatar_url":"https://avatars2.githubusercontent.com/u/27806?v=4","gravatar_id":"","url":"https://api.github.com/users/swinton","html_url":"https://github.com/swinton","followers_url":"https://api.github.com/users/swinton/followers","following_url":"https://api.github.com/users/swinton/following{/other_user}","gists_url":"https://api.github.com/users/swinton/gists{/gist_id}","starred_url":"https://api.github.com/users/swinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swinton/subscriptions","organizations_url":"https://api.github.com/users/swinton/orgs","repos_url":"https://api.github.com/users/swinton/repos","events_url":"https://api.github.com/users/swinton/events{/privacy}","received_events_url":"https://api.github.com/users/swinton/received_events","type":"User","site_admin":true},"repo":{"id":146487421,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY0ODc0MjE=","name":"routes","full_name":"swinton/routes","owner":{"login":"swinton","id":27806,"node_id":"MDQ6VXNlcjI3ODA2","avatar_url":"https://avatars2.githubusercontent.com/u/27806?v=4","gravatar_id":"","url":"https://api.github.com/users/swinton","html_url":"https://github.com/swinton","followers_url":"https://api.github.com/users/swinton/followers","following_url":"https://api.github.com/users/swinton/following{/other_user}","gists_url":"https://api.github.com/users/swinton/gists{/gist_id}","starred_url":"https://api.github.com/users/swinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swinton/subscriptions","organizations_url":"https://api.github.com/users/swinton/orgs","repos_url":"https://api.github.com/users/swinton/repos","events_url":"https://api.github.com/users/swinton/events{/privacy}","received_events_url":"https://api.github.com/users/swinton/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/swinton/routes","description":"machine-readable, always up-to-date GitHub REST API route specifications","fork":true,"url":"https://api.github.com/repos/swinton/routes","forks_url":"https://api.github.com/repos/swinton/routes/forks","keys_url":"https://api.github.com/repos/swinton/routes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swinton/routes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swinton/routes/teams","hooks_url":"https://api.github.com/repos/swinton/routes/hooks","issue_events_url":"https://api.github.com/repos/swinton/routes/issues/events{/number}","events_url":"https://api.github.com/repos/swinton/routes/events","assignees_url":"https://api.github.com/repos/swinton/routes/assignees{/user}","branches_url":"https://api.github.com/repos/swinton/routes/branches{/branch}","tags_url":"https://api.github.com/repos/swinton/routes/tags","blobs_url":"https://api.github.com/repos/swinton/routes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swinton/routes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swinton/routes/git/refs{/sha}","trees_url":"https://api.github.com/repos/swinton/routes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swinton/routes/statuses/{sha}","languages_url":"https://api.github.com/repos/swinton/routes/languages","stargazers_url":"https://api.github.com/repos/swinton/routes/stargazers","contributors_url":"https://api.github.com/repos/swinton/routes/contributors","subscribers_url":"https://api.github.com/repos/swinton/routes/subscribers","subscription_url":"https://api.github.com/repos/swinton/routes/subscription","commits_url":"https://api.github.com/repos/swinton/routes/commits{/sha}","git_commits_url":"https://api.github.com/repos/swinton/routes/git/commits{/sha}","comments_url":"https://api.github.com/repos/swinton/routes/comments{/number}","issue_comment_url":"https://api.github.com/repos/swinton/routes/issues/comments{/number}","contents_url":"https://api.github.com/repos/swinton/routes/contents/{+path}","compare_url":"https://api.github.com/repos/swinton/routes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swinton/routes/merges","archive_url":"https://api.github.com/repos/swinton/routes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swinton/routes/downloads","issues_url":"https://api.github.com/repos/swinton/routes/issues{/number}","pulls_url":"https://api.github.com/repos/swinton/routes/pulls{/number}","milestones_url":"https://api.github.com/repos/swinton/routes/milestones{/number}","notifications_url":"https://api.github.com/repos/swinton/routes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swinton/routes/labels{/name}","releases_url":"https://api.github.com/repos/swinton/routes/releases{/id}","deployments_url":"https://api.github.com/repos/swinton/routes/deployments","created_at":"2018-08-28T18:09:48Z","updated_at":"2018-08-28T18:09:51Z","pushed_at":"2018-09-14T18:55:17Z","git_url":"git://github.com/swinton/routes.git","ssh_url":"git@github.com:swinton/routes.git","clone_url":"https://github.com/swinton/routes.git","svn_url":"https://github.com/swinton/routes","homepage":"https://octokit.github.io/routes","size":7476,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"octokit:master","ref":"master","sha":"147ba57cd9d4c3c74e2c8e74f7bf784eec5cb349","user":{"login":"octokit","id":3430433,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MzA0MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/3430433?v=4","gravatar_id":"","url":"https://api.github.com/users/octokit","html_url":"https://github.com/octokit","followers_url":"https://api.github.com/users/octokit/followers","following_url":"https://api.github.com/users/octokit/following{/other_user}","gists_url":"https://api.github.com/users/octokit/gists{/gist_id}","starred_url":"https://api.github.com/users/octokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octokit/subscriptions","organizations_url":"https://api.github.com/users/octokit/orgs","repos_url":"https://api.github.com/users/octokit/repos","events_url":"https://api.github.com/users/octokit/events{/privacy}","received_events_url":"https://api.github.com/users/octokit/received_events","type":"Organization","site_admin":false},"repo":{"id":124289805,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQyODk4MDU=","name":"routes","full_name":"octokit/routes","owner":{"login":"octokit","id":3430433,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MzA0MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/3430433?v=4","gravatar_id":"","url":"https://api.github.com/users/octokit","html_url":"https://github.com/octokit","followers_url":"https://api.github.com/users/octokit/followers","following_url":"https://api.github.com/users/octokit/following{/other_user}","gists_url":"https://api.github.com/users/octokit/gists{/gist_id}","starred_url":"https://api.github.com/users/octokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octokit/subscriptions","organizations_url":"https://api.github.com/users/octokit/orgs","repos_url":"https://api.github.com/users/octokit/repos","events_url":"https://api.github.com/users/octokit/events{/privacy}","received_events_url":"https://api.github.com/users/octokit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/octokit/routes","description":"machine-readable, always up-to-date GitHub REST API route specifications","fork":false,"url":"https://api.github.com/repos/octokit/routes","forks_url":"https://api.github.com/repos/octokit/routes/forks","keys_url":"https://api.github.com/repos/octokit/routes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octokit/routes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octokit/routes/teams","hooks_url":"https://api.github.com/repos/octokit/routes/hooks","issue_events_url":"https://api.github.com/repos/octokit/routes/issues/events{/number}","events_url":"https://api.github.com/repos/octokit/routes/events","assignees_url":"https://api.github.com/repos/octokit/routes/assignees{/user}","branches_url":"https://api.github.com/repos/octokit/routes/branches{/branch}","tags_url":"https://api.github.com/repos/octokit/routes/tags","blobs_url":"https://api.github.com/repos/octokit/routes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octokit/routes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octokit/routes/git/refs{/sha}","trees_url":"https://api.github.com/repos/octokit/routes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octokit/routes/statuses/{sha}","languages_url":"https://api.github.com/repos/octokit/routes/languages","stargazers_url":"https://api.github.com/repos/octokit/routes/stargazers","contributors_url":"https://api.github.com/repos/octokit/routes/contributors","subscribers_url":"https://api.github.com/repos/octokit/routes/subscribers","subscription_url":"https://api.github.com/repos/octokit/routes/subscription","commits_url":"https://api.github.com/repos/octokit/routes/commits{/sha}","git_commits_url":"https://api.github.com/repos/octokit/routes/git/commits{/sha}","comments_url":"https://api.github.com/repos/octokit/routes/comments{/number}","issue_comment_url":"https://api.github.com/repos/octokit/routes/issues/comments{/number}","contents_url":"https://api.github.com/repos/octokit/routes/contents/{+path}","compare_url":"https://api.github.com/repos/octokit/routes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octokit/routes/merges","archive_url":"https://api.github.com/repos/octokit/routes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octokit/routes/downloads","issues_url":"https://api.github.com/repos/octokit/routes/issues{/number}","pulls_url":"https://api.github.com/repos/octokit/routes/pulls{/number}","milestones_url":"https://api.github.com/repos/octokit/routes/milestones{/number}","notifications_url":"https://api.github.com/repos/octokit/routes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octokit/routes/labels{/name}","releases_url":"https://api.github.com/repos/octokit/routes/releases{/id}","deployments_url":"https://api.github.com/repos/octokit/routes/deployments","created_at":"2018-03-07T20:20:54Z","updated_at":"2018-09-04T08:18:58Z","pushed_at":"2018-09-14T18:55:19Z","git_url":"git://github.com/octokit/routes.git","ssh_url":"git@github.com:octokit/routes.git","clone_url":"https://github.com/octokit/routes.git","svn_url":"https://github.com/octokit/routes","homepage":"https://octokit.github.io/routes","size":6815,"stargazers_count":25,"watchers_count":25,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":13,"open_issues":26,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/octokit/routes/pulls/264"},"html":{"href":"https://github.com/octokit/routes/pull/264"},"issue":{"href":"https://api.github.com/repos/octokit/routes/issues/264"},"comments":{"href":"https://api.github.com/repos/octokit/routes/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/octokit/routes/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/octokit/routes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/octokit/routes/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/octokit/routes/statuses/0ee17adeefded605cf3f6412f6f3676eebe46220"}},"author_association":"NONE"}}
{"actor":{"display_login":"swinton"}}