chore: update gh api fetch

pull/26460/head^2
Nicolás Quiroz 2 years ago
parent 37537d0520
commit 681aa89dcd
  1. 8
      src/utils/fetchLatestReleaseCommit.ts
  2. 8
      src/utils/fetchLatestReleaseVersionAndName.ts

@ -1,7 +1,13 @@
import { ALL_GETH_COMMITS_URL } from '../constants';
export const fetchLatestReleaseCommit = (versionNumber: string) => {
return fetch(`${ALL_GETH_COMMITS_URL}/${versionNumber}`)
const headers = new Headers({
// Note: this token expires on Dec 16, 2023
// check fine-grained tokens https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#about-personal-access-tokens
Authorization: 'Token ' + process.env.GITHUB_TOKEN_READ_ONLY
});
return fetch(`${ALL_GETH_COMMITS_URL}/${versionNumber}`, { headers })
.then(response => response.json())
.then(commit => commit.sha.slice(0, 8));
};

@ -1,7 +1,13 @@
import { LATEST_GETH_RELEASE_URL } from '../constants';
export const fetchLatestReleaseVersionAndName = () => {
return fetch(LATEST_GETH_RELEASE_URL)
const headers = new Headers({
// Note: this token expires on Dec 16, 2023
// check fine-grained tokens https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#about-personal-access-tokens
Authorization: 'Token ' + process.env.GITHUB_TOKEN_READ_ONLY
});
return fetch(LATEST_GETH_RELEASE_URL, { headers })
.then(response => response.json())
.then(release => {
return {

Loading…
Cancel
Save