Skip to content

Commit

Permalink
Renames token (GITHUB_TOKEN is added by GH actions) (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpedromoreno authored Mar 28, 2020
1 parent f1f8021 commit f70ced8
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
test:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
G4S_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
documentation:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
G4S_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lazy val github4s =
buildInfoKeys := Seq[BuildInfoKey](
name,
version,
"token" -> sys.env.getOrElse("GITHUB_TOKEN", "")
"token" -> sys.env.getOrElse("G4S_TOKEN", "")
),
buildInfoPackage := "github4s"
)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The first step we need to take in order to run the tests is a valid token which
environment variable:

```bash
export GITHUB_TOKEN=aaaa
export G4S_TOKEN=aaaa
```

You can create a token on Github: <https://github.com/settings/tokens>.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ As an introductory example, we can get a user with the following:

```scala mdoc:silent
import github4s.Github
val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val user1 = Github[IO](httpClient, accessToken).users.get("rafaparadela")
```

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/gist.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand All @@ -49,7 +49,7 @@ To create a gist:
```scala mdoc:compile-only
import github4s.domain.GistFile
val gistfiles = Map(
"token.scala" -> GistFile("val accessToken = sys.env.get(\"GITHUB_TOKEN\")"),
"token.scala" -> GistFile("val accessToken = sys.env.get(\"G4S_TOKEN\")"),
"gh4s.scala" -> GistFile("val gh = Github(accessToken)")
)
val newGist = gh.gists.newGist("Github4s entry point", public = true, gistfiles)
Expand Down Expand Up @@ -111,7 +111,7 @@ To edit a gist (change description, update content of _token.scala_, rename _gh4
```scala mdoc:compile-only
import github4s.domain.EditGistFile
val editfiles = Map(
"token.scala" -> Some(EditGistFile("lazy val accessToken = sys.env.get(\"GITHUB_TOKEN\")")),
"token.scala" -> Some(EditGistFile("lazy val accessToken = sys.env.get(\"G4S_TOKEN\")")),
"gh4s.scala" -> Some(EditGistFile("val gh = Github(accessToken)", Some("GH4s.scala"))),
"token.class" -> None
)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/git_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/pull_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ val httpClient: Client[IO] = {
JavaNetClientBuilder[IO](blocker).create // use BlazeClientBuilder for production use
}

val accessToken = sys.env.get("GITHUB_TOKEN")
val accessToken = sys.env.get("G4S_TOKEN")
val gh = Github[IO](httpClient, accessToken)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class IntegrationSpec

object Integration
extends Tag(
if (sys.env.get("GITHUB_TOKEN").isDefined) ""
if (sys.env.get("G4S_TOKEN").exists(_.nonEmpty)) ""
else classOf[Ignore].getName
)

Expand All @@ -59,7 +59,7 @@ abstract class BaseIntegrationSpec

val clientResource: Resource[IO, Client[IO]] = BlazeClientBuilder[IO](executionContext).resource

def accessToken: Option[String] = sys.env.get("GITHUB_TOKEN")
def accessToken: Option[String] = sys.env.get("G4S_TOKEN")

def testIsRight[A](response: GHResponse[A], f: A => Assertion = (_: A) => succeed): Assertion = {
response.result.isRight shouldBe true
Expand Down
2 changes: 1 addition & 1 deletion project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ object ProjectPlugin extends AutoPlugin {
case _ => withStripedLinter
}) :+ "-language:higherKinds"
},
orgGithubTokenSetting := "GITHUB_TOKEN",
orgGithubTokenSetting := "G4S_TOKEN",
orgBadgeListSetting := List(
TravisBadge.apply(_),
GitterBadge.apply(_),
Expand Down

0 comments on commit f70ced8

Please sign in to comment.