From 54564a5ba5477ff439425e871d6b69a8ec587c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Fri, 18 Oct 2024 09:36:10 +0900 Subject: [PATCH] refactor: remove getDefaultBranch function and set branch to "__STORAGE__" for automated updates --- helpers/git.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/helpers/git.ts b/helpers/git.ts index 00ef3e5b0..c9df52f39 100644 --- a/helpers/git.ts +++ b/helpers/git.ts @@ -2,19 +2,6 @@ import { Statistics } from "../types/statistics"; import { DEVPOOL_OWNER_NAME, DEVPOOL_REPO_NAME, GitHubIssue, octokit } from "./directory/directory"; let gitChanges: Array<{ path: string; content: string }> = []; -export async function getDefaultBranch(owner: string, repo: string): Promise { - try { - const { data } = await octokit.rest.repos.get({ - owner, - repo, - }); - return data.default_branch; - } catch (error) { - console.error(`Error fetching default branch: ${error}`); - throw error; - } -} - async function gitCommit(data: unknown, fileName: string) { try { gitChanges.push({ @@ -41,7 +28,7 @@ export async function gitPush() { try { const owner = DEVPOOL_OWNER_NAME; const repo = DEVPOOL_REPO_NAME; - const branch = await getDefaultBranch(owner, repo); + const branch = "__STORAGE__"; // Special branch for automated data updates const { data: refData } = await octokit.rest.git.getRef({ owner, repo,