mirror of
https://github.com/godotengine/godot-team-reports.git
synced 2025-12-31 13:48:17 +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
|
||||
run: npm run compose-db
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Deploy to GitHub Pages 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
|
||||
@@ -22,6 +22,9 @@ async function fetchGithub(url) {
|
||||
const init = {};
|
||||
init.headers = {};
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user