@@ -13,6 +13,7 @@ avoid setting the `GITHUB_AUTH_TOKEN` environment variable on your test & prod a
13
13
and instead only set it on the app where you push your code & which runs the buildpack.
14
14
15
15
[ github-builds ] : https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth
16
+ [ github-oauth ] : http://developer.github.com/v3/oauth/#create-a-new-authorization
16
17
17
18
Requirements
18
19
------------
@@ -23,22 +24,62 @@ The app must have `user-env-compile` enabled for the buildpack to have access to
23
24
24
25
[ Read more aobut user-env-compile.] ( https://devcenter.heroku.com/articles/labs-user-env-compile )
25
26
27
+ You'll also need to make a Github authorization token. Here's the ` curl ` command you can use.
28
+
29
+ ``` console
30
+ $ curl -u ' my-read-only-user' -d ' {"scopes":["repo"],"note":"GITHUB_AUTH_TOKEN for Heroku deplyoments","note_url":"https://github.com/timshadel/heroku-buildpack-github-netrc"}' https://api.github.com/authorizations # Github API call
31
+ Enter host password for user 'username': [type password]
32
+
33
+ {
34
+ "scopes": [
35
+ "repo"
36
+ ],
37
+ "token": "your_token",
38
+ "app": {
39
+ "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api",
40
+ "name": "Help example (API)"
41
+ },
42
+ "url": "https://api.github.com/authorizations/123456",
43
+ "note": "GITHUB_AUTH_TOKEN for Heroku deplyoments.",
44
+ "note_url": "https://github.com/timshadel/heroku-buildpack-github-netrc",
45
+ "id": 123456,
46
+ }
47
+ ```
48
+
49
+ This token may be revoked at any time by visiting the [ Applications area] [ github-apps ]
50
+ of your Github account. You'll see the ` note ` linked to the ` note_url ` and the revoke
51
+ button right next to it.
52
+
53
+ Check out the [ Github help article] [ github-oauth-help ] and [ OAuth documentation] [ github-oauth ] for more details.
54
+
55
+ [ github-apps ] : https://github.com/settings/applications
56
+ [ github-oauth-help ] : https://help.github.com/articles/creating-an-oauth-token-for-command-line-use
57
+
26
58
Usage
27
59
-----
28
60
29
61
Example usage:
30
62
31
63
$ heroku create --stack cedar --buildpack http://github.com/fs-webdev/heroku-buildpack-netrc.git
32
64
33
- # Enable
65
+ Enable config vars to be visible during buildpack execution, and set the token.
66
+
34
67
$ heroku labs:enable user-env-compile
35
68
$ heroku config:set GITHUB_AUTH_TOKEN=<my-read-only-token>
36
69
37
- $ git push heroku master
38
- ...
39
- -----> Heroku receiving push
40
- -----> Fetching custom buildpack
41
- -----> Github .netrc app detected
42
- Generated .netrc & .curlrc files (available only at build-time)
70
+ Deploy your app.
71
+
72
+ ``` console
73
+ $ git push heroku master # push your changes to Heroku
74
+
75
+ ...git output...
43
76
44
- TODO!
77
+ -----> Fetching custom git buildpack... done
78
+ -----> Multipack app detected
79
+ =====> Downloading Buildpack: https://github.com/timshadel/heroku-buildpack-github-netrc.git
80
+ =====> Detected Framework: github-netrc
81
+ Generated .netrc & .curlrc files (available only at build-time)
82
+ Github User: my-read-only-user
83
+ Authorization: GITHUB_AUTH_TOKEN for Heroku deplyoments (private repo access)
84
+ Organizations: my-org, another-org
85
+ ```
0 commit comments