Skip to content

Commit 54dc5f4

Browse files
committed
changing token name
1 parent 0ba82d5 commit 54dc5f4

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Replace app.yml secrets
4040
4141
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
4343
PROJECT_ID: ${{ secrets.PROJECT_ID }}
4444
DB_USER: ${{ secrets.DB_USER}}
4545
DB_NAME: ${{ secrets.DB_NAME}}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Below are the available endpoints for each table.
2828
2929
4. **OPTIONAL** In order to test the Github API locally, you need to provide a [Github Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) in your `.env` file. The token only needs `read:user` and `public_repo`
3030
```
31-
GITHUB_TOKEN=<Github Token>
31+
GH_TOKEN=<Github Token>
3232
```
3333
3434
5. Start the server

app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ entrypoint: yarn start
1111

1212
# Environment variables (replace with your actual values or secrets)
1313
env_variables:
14-
GITHUB_TOKEN: $GITHUB_TOKEN
14+
GH_TOKEN: GH_TOKEN
1515
PROJECT_ID: $PROJECT_ID
1616
DB_USER: $DB_USER
1717
DB_NAME: $DB_NAME

src/routes/githubValidationRoute.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ const daysSince = (date) => {
1111
router.get('/gh-validation/:userId', async (req, res) => {
1212
const { userId } = req.params;
1313

14-
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
15-
if (!GITHUB_TOKEN) {
14+
const GH_TOKEN = process.env.GH_TOKEN;
15+
if (!GH_TOKEN) {
1616
return res.status(500).json({ error: "GitHub token not configured." });
1717
}
1818

1919
try {
2020
const response = await fetch(`https://api.github.com/user/${userId}`, {
2121
headers: {
22-
Authorization: `token ${GITHUB_TOKEN}`,
22+
Authorization: `token ${GH_TOKEN}`,
2323
Accept: 'application/vnd.github.v3+json'
2424
}
2525
});

0 commit comments

Comments
 (0)