Skip to content

Commit

Permalink
Remove gh API call from versions api
Browse files Browse the repository at this point in the history
  • Loading branch information
samad-yar-khan committed Jul 10, 2024
1 parent ce5a39f commit 0f45223
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions web-server/pages/api/internal/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ async function fetchDockerHubTags(): Promise<TagCompressed[]> {
}));
}

async function fetchLatestGitHubCommit(): Promise<GitHubCommit> {
const apiUrl = `https://api.github.com/repos/${githubOrgName}/${githubRepoName}/commits/${defaultBranch}`;
const response = await axios.get<GitHubCommit>(apiUrl);
const latestCommit = response.data;
return latestCommit;
}

function isUpdateAvailable({
localVersionInfo,
dockerLatestRemoteTag
Expand All @@ -135,9 +128,8 @@ function isUpdateAvailable({
async function checkNewImageRelease(): Promise<CheckNewVersionResponse> {
const versionInfo = getProjectVersionInfo();

const [dockerRemoteTags, githubLatestCommit] = await Promise.all([
const [dockerRemoteTags] = await Promise.all([
fetchDockerHubTags(),
fetchLatestGitHubCommit()
]);

dockerRemoteTags.sort(
Expand Down

0 comments on commit 0f45223

Please sign in to comment.