Skip to content

Commit 2960ed1

Browse files
committed
Add more info on how to obtain an auth token.
Add example token command, details about auth token, and a link to Github screen to revoke the token.
1 parent 07f5ee2 commit 2960ed1

File tree

1 file changed

+49
-8
lines changed

1 file changed

+49
-8
lines changed

README.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ avoid setting the `GITHUB_AUTH_TOKEN` environment variable on your test & prod a
1313
and instead only set it on the app where you push your code & which runs the buildpack.
1414

1515
[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
1617

1718
Requirements
1819
------------
@@ -23,22 +24,62 @@ The app must have `user-env-compile` enabled for the buildpack to have access to
2324

2425
[Read more aobut user-env-compile.](https://devcenter.heroku.com/articles/labs-user-env-compile)
2526

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+
2658
Usage
2759
-----
2860

2961
Example usage:
3062

3163
$ heroku create --stack cedar --buildpack http://github.com/fs-webdev/heroku-buildpack-netrc.git
3264

33-
# Enable
65+
Enable config vars to be visible during buildpack execution, and set the token.
66+
3467
$ heroku labs:enable user-env-compile
3568
$ heroku config:set GITHUB_AUTH_TOKEN=<my-read-only-token>
3669

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...
4376

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

Comments
 (0)