mirror of
https://github.com/godotengine/godot-team-reports.git
synced 2026-09-03 23:39:52 +03:00
Use GITHUB_TOKEN for API requests
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -34,6 +34,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Fetch pull request data
|
- name: Fetch pull request data
|
||||||
run: npm run compose-db
|
run: npm run compose-db
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages 🚀
|
- name: Deploy to GitHub Pages 🚀
|
||||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ async function fetchGithub(url) {
|
|||||||
const init = {};
|
const init = {};
|
||||||
init.headers = {};
|
init.headers = {};
|
||||||
init.headers["Accept"] = "application/vnd.github.v3+json";
|
init.headers["Accept"] = "application/vnd.github.v3+json";
|
||||||
|
if (process.env.GITHUB_TOKEN) {
|
||||||
|
init.headers["Authorization"] = `token ${process.env.GITHUB_TOKEN}`;
|
||||||
|
}
|
||||||
|
|
||||||
return await fetch(`https://api.github.com${url}`, init);
|
return await fetch(`https://api.github.com${url}`, init);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user