Skip to content

Commit 8d70a0e

Browse files
authored
Merge pull request #15625 from ethereum/fix-envvar
fix: rename env var to not be public
2 parents e71e80d + 564e636 commit 8d70a0e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME=insertValue
1515

1616
# Github token for read-only use with api functions
17-
# NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY=insertValue
17+
# GITHUB_TOKEN_READ_ONLY=insertValue
1818

1919
# Etherscan API key (required for Etherscan API fetches)
2020
# ETHERSCAN_API_KEY=insertValue

docs/api-keys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ We recommend setting this up when running the project locally, as we use the Git
1111
1212
```sh
1313
# .env Example:
14-
NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY=48f84de812090000demo00000000697cf6e6a059
14+
GITHUB_TOKEN_READ_ONLY=48f84de812090000demo00000000697cf6e6a059
1515
```
1616

1717
2. Add Etherscan API token (free)

src/lib/api/fetchGFIs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const fetchGFIs = async () => {
1616
try {
1717
const response = await fetch(url, {
1818
headers: {
19-
Authorization: `token ${process.env.NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY}`,
19+
Authorization: `token ${process.env.GITHUB_TOKEN_READ_ONLY}`,
2020
Accept: "application/vnd.github.v3+json",
2121
},
2222
})

src/lib/api/fetchGitHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async function fetchWithRateLimit(filepath: string): Promise<Commit[]> {
1111
url.searchParams.set("path", filepath)
1212
url.searchParams.set("sha", "master")
1313

14-
const gitHubToken = process.env.NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY
14+
const gitHubToken = process.env.GITHUB_TOKEN_READ_ONLY
1515

1616
// If no token available, return empty array
1717
if (!gitHubToken) return []

src/lib/api/ghRepoData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const ghRepoData = async (githubUrl: string) => {
106106
`https://api.github.com/repos/${repoOwner}/${repoName}`,
107107
{
108108
headers: {
109-
Authorization: `Bearer ${process.env.NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY}`,
109+
Authorization: `Bearer ${process.env.GITHUB_TOKEN_READ_ONLY}`,
110110
},
111111
}
112112
)
@@ -121,7 +121,7 @@ export const ghRepoData = async (githubUrl: string) => {
121121
`https://api.github.com/repos/${repoOwner}/${repoName}/languages`,
122122
{
123123
headers: {
124-
Authorization: `Bearer ${process.env.NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY}`,
124+
Authorization: `Bearer ${process.env.GITHUB_TOKEN_READ_ONLY}`,
125125
},
126126
}
127127
)

0 commit comments

Comments
 (0)