Skip to content

Commit

Permalink
refactor: remove getDefaultBranch function and set branch to "__STORA…
Browse files Browse the repository at this point in the history
…GE__" for automated updates
  • Loading branch information
0x4007 committed Oct 18, 2024
1 parent b570de6 commit 54564a5
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions helpers/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> {
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({
Expand All @@ -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,
Expand Down

0 comments on commit 54564a5

Please sign in to comment.