diff --git a/.env.sample b/.env.sample index 969570a7..0c4037eb 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,2 @@ -GITHUB_TOKEN=your_token +GATSBY_GITHUB_TOKEN=your_token GATSBY_MAPBOX_ACCESS_TOKEN= \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e90e7481..e4f1b81b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,4 +37,4 @@ jobs: run: npm run build env: CI: true - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GATSBY_GITHUB_TOKEN: ${{ secrets.GATSBY_GITHUB_TOKEN }} diff --git a/README.md b/README.md index 590be1bd..8ddb7b98 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ You can simply use [Docker](https://www.docker.com) & [Docker Compose](https://d git clone git@github.com:kremalicious/blog.git cd blog/ -# GITHUB_TOKEN is required for some parts +# GATSBY_GITHUB_TOKEN is required for some parts cp .env.sample .env vi .env diff --git a/gatsby-config.js b/gatsby-config.js index f6573890..d7cbc94a 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,10 +1,10 @@ require('dotenv').config() -if (!process.env.GITHUB_TOKEN) { +if (!process.env.GATSBY_GITHUB_TOKEN) { // eslint-disable-next-line console.warn(` - ⚠️ A GitHub token is required to build some parts of the blog. + ⚠️ A GitHub token as GATSBY_GITHUB_TOKEN is required to build some parts of the blog. ⚠️ Check the README https://github.com/kremalicious/blog#-development. `) diff --git a/gatsby/sources.js b/gatsby/sources.js index fd68c0f6..e48a7c60 100644 --- a/gatsby/sources.js +++ b/gatsby/sources.js @@ -36,7 +36,7 @@ module.exports = [ fieldName: 'github', url: 'https://api.github.com/graphql', headers: { - Authorization: `bearer ${process.env.GITHUB_TOKEN}` + Authorization: `bearer ${process.env.GATSBY_GITHUB_TOKEN}` }, // Additional options to pass to node-fetch fetchOptions: {},