Skip to content

Commit

Permalink
Merge branch 'readme'
Browse files Browse the repository at this point in the history
  • Loading branch information
djspiewak committed Mar 6, 2020
2 parents 80b5942 + 5535f2e commit 226f9c0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ As mentioned earlier, environment variables are a good default. For example, I h
githubTokenSource := TokenSource.Environment("GITHUB_TOKEN")
```

To use a token from `~/.gitconfig` you should add:

```sbt
githubTokenSource := TokenSource.GitConfig("github.token")
```

This assumes you have your token stored there like this:

```gitconfig
[github]
token = TOKEN_DATA
```



The `||` combinator allows you to configure multiple token sources which will be tried in order on first-read of the setting.

Note that your CI server will need to set the `GITHUB_TOKEN` environment variable as well, as well as any collaborators on your project. The environment-specific nature of these login credentials are a major part of why they are *not* just strings sitting in the `build.sbt` file. As an example, if you're using Travis, you can do something like the following:
Expand Down

0 comments on commit 226f9c0

Please sign in to comment.