mirror of https://github.com/ethereum/go-ethereum
parent
37537d0520
commit
681aa89dcd
@ -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)); |
||||
}; |
||||
|
Loading…
Reference in new issue