{"action":"created","issue":{"url":"https://api.github.com/repos/r-lib/usethis/issues/40","repository_url":"https://api.github.com/repos/r-lib/usethis","labels_url":"https://api.github.com/repos/r-lib/usethis/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/r-lib/usethis/issues/40/comments","events_url":"https://api.github.com/repos/r-lib/usethis/issues/40/events","html_url":"https://github.com/r-lib/usethis/issues/40","id":247530676,"number":40,"title":"Handle host for use_github() same way as auth_token","user":{"login":"r-pkgs-bot","id":26149481,"avatar_url":"https://avatars3.githubusercontent.com/u/26149481?v=4","gravatar_id":"","url":"https://api.github.com/users/r-pkgs-bot","html_url":"https://github.com/r-pkgs-bot","followers_url":"https://api.github.com/users/r-pkgs-bot/followers","following_url":"https://api.github.com/users/r-pkgs-bot/following{/other_user}","gists_url":"https://api.github.com/users/r-pkgs-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/r-pkgs-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-pkgs-bot/subscriptions","organizations_url":"https://api.github.com/users/r-pkgs-bot/orgs","repos_url":"https://api.github.com/users/r-pkgs-bot/repos","events_url":"https://api.github.com/users/r-pkgs-bot/events{/privacy}","received_events_url":"https://api.github.com/users/r-pkgs-bot/received_events","type":"User","site_admin":false},"labels":[{"id":551814870,"url":"https://api.github.com/repos/r-lib/usethis/labels/feature","name":"feature","color":"009800","default":false},{"id":551814871,"url":"https://api.github.com/repos/r-lib/usethis/labels/usethis","name":"usethis","color":"eeeeee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-02T21:39:24Z","updated_at":"2017-08-02T21:39:25Z","closed_at":null,"body":"<a href=\"https://github.com/jennybc\"><img src=\"https://avatars3.githubusercontent.com/u/599454?v=4\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [jennybc](https://github.com/jennybc)**\n_Wednesday Sep 07, 2016 at 23:33 GMT_\n_Originally opened as https://github.com/hadley/devtools/issues/1333_\n\n----\n\nI propose handling the host for `use_github()` in a similar fashion as `auth_token`, which is this:\n- by default, helper function `github_pat()` is called, which tries to retrieve PAT from env var GITHUB_PAT\n\nCould we use an env var named GITHUB_API_URL for this? I suggest it because [`gh`](https://github.com/gaborcsardi/gh) already [does this](https://github.com/gaborcsardi/gh/blob/b7d3b8071ab24c67fd6db10f2997b3ab9d5f612d/R/package.R#L94). If GITHUB_API_URL is not defined, then use existing default `https://api.github.com`.\n\nThis makes it easier to define a user-level GITHUB_PAT for github.com and, for individual projects, store an alternative host and PAT for GitHub Enterprise in a project-level `.Renviron`.\n\ncc @ijlyttle \n\n"},"comment":{"url":"https://api.github.com/repos/r-lib/usethis/issues/comments/319806681","html_url":"https://github.com/r-lib/usethis/issues/40#issuecomment-319806681","issue_url":"https://api.github.com/repos/r-lib/usethis/issues/40","id":319806681,"user":{"login":"r-pkgs-bot","id":26149481,"avatar_url":"https://avatars3.githubusercontent.com/u/26149481?v=4","gravatar_id":"","url":"https://api.github.com/users/r-pkgs-bot","html_url":"https://github.com/r-pkgs-bot","followers_url":"https://api.github.com/users/r-pkgs-bot/followers","following_url":"https://api.github.com/users/r-pkgs-bot/following{/other_user}","gists_url":"https://api.github.com/users/r-pkgs-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/r-pkgs-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-pkgs-bot/subscriptions","organizations_url":"https://api.github.com/users/r-pkgs-bot/orgs","repos_url":"https://api.github.com/users/r-pkgs-bot/repos","events_url":"https://api.github.com/users/r-pkgs-bot/events{/privacy}","received_events_url":"https://api.github.com/users/r-pkgs-bot/received_events","type":"User","site_admin":false},"created_at":"2017-08-02T21:39:25Z","updated_at":"2017-08-02T21:39:25Z","body":"<a href=\"https://github.com/ijlyttle\"><img src=\"https://avatars3.githubusercontent.com/u/2800934?v=4\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [ijlyttle](https://github.com/ijlyttle)**\n_Thursday Sep 08, 2016 at 15:46 GMT_\n\n----\n\nI'm intrigued by the idea. It might avoid the necessity for a company-specific function like I have written and packaged (privately), `use_github_se()`, which uses our host as a default, and looks for an env var named GITHUB_SE_PAT. \n\nMaybe the company-specific helper function would do something different, writing the project-level `.Renviron`.\n\nThe one thing I cannot reason about is what might happen if we rely on a project-level definition of \nGITHUB_PAT, then `install_github(\"hadley/newpackage\")` - would things fail in a way that would be difficult to figure out? \n\nI will have to make an experiment :)\n\n"}}
{"actor":{"display_login":"r-pkgs-bot"}}