Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open source dashboard: rename default branch option and set hermit's default branch #54

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects-dashboard/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineCollection, z } from "astro:content";
const repoSchema = z.object({
owner: z.string(),
name: z.string(),
mainBranch: z.string().optional(),
defaultBranch: z.string().optional(),
subPath: z.string().optional(),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repo:
owner: "cashapp"
name: "AccessibilitySnapshot"
mainBranch: "master"
defaultBranch: "master"
title: "AccessibilitySnapshot"
description: "Easy regression testing for iOS accessibility"
branding: "cashapp"
Expand Down
1 change: 1 addition & 0 deletions projects-dashboard/src/content/project/cashapp_hermit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
repo:
owner: cashapp
name: hermit
defaultBranch: "master"
title: hermit
description: Hermit manages isolated, self-bootstrapping sets of tools in software projects.
branding: cashapp
Expand Down
2 changes: 1 addition & 1 deletion projects-dashboard/src/content/project/square_okhttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repo:
owner: "square"
name: "okhttp"
mainBranch: "master"
defaultBranch: "master"
title: "OkHttp"
description: "Square’s meticulous HTTP client for the JVM, Android, and GraalVM."
branding: "square"
Expand Down
2 changes: 1 addition & 1 deletion projects-dashboard/src/content/project/square_okio.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repo:
owner: "square"
name: "okio"
mainBranch: "master"
defaultBranch: "master"
title: "okio"
description: "A modern I/O library for Android, Java, and Kotlin Multiplatform."
branding: "square"
Expand Down
12 changes: 6 additions & 6 deletions projects-dashboard/src/lib/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ function getGithubActionsBadge(
value = "ci.yml",
label = "ci"
): [string, string] {
const branch = repo.mainBranch ?? "main";
const branch = repo.defaultBranch ?? "main";
const badgeSrc = `https://img.shields.io/github/actions/workflow/status/${repo.owner}/${repo.name}/${value}?style=flat-square&branch=${branch}&logo=github&label=${label}&logoColor=FFFFFF`;
const href = `https://github.com/${repo.owner}/${repo.name}/actions/workflows/${value}`;
return [badgeSrc, href];
}

function getGithubLicenseBadge(repo: Repo): [string, string] {
const branch = repo.mainBranch ?? "main";
const branch = repo.defaultBranch ?? "main";
const badgeSrc = `https://img.shields.io/github/license/${repo.owner}/${repo.name}?style=flat-square&color=4c1&label=license`;
const href = `https://github.com/${repo.owner}/${repo.name}/blob/${branch}/LICENSE`;
return [badgeSrc, href];
Expand Down Expand Up @@ -60,7 +60,7 @@ function getOssfBadge(repo: Repo): [string, string] {
}

function getCodecovBadge(repo: Repo, token?: string): [string, string] {
const branch = repo.mainBranch ?? "main";
const branch = repo.defaultBranch ?? "main";
const badgeSrc = `https://img.shields.io/codecov/c/gh/${repo.owner}/${repo.name}/${branch}?label=codecov&style=flat-square&token=${token}`;
const href = `https://codecov.io/github/${repo.owner}/${repo.name}`;
return [badgeSrc, href];
Expand Down Expand Up @@ -119,7 +119,7 @@ function getReferenceDocsBadge(value?: string): [string, string] {
}

function getCodeOfConductBadge(repo: Repo, value?: string): [string, string] {
const branch = repo.mainBranch ?? "main";
const branch = repo.defaultBranch ?? "main";
const badgeSrc = `https://img.shields.io/badge/Code of Conduct-blue?style=flat-square`;
const href = `https://github.com/${repo.owner}/${repo.name}/blob/${branch}/${value}`;
return [badgeSrc, href];
Expand All @@ -129,7 +129,7 @@ function getContributionGuidelinesBadge(
repo: Repo,
value?: string
): [string, string] {
const branch = repo.mainBranch ?? "main";
const branch = repo.defaultBranch ?? "main";
const badgeSrc = `https://img.shields.io/badge/Contribution Guidelines-orange?style=flat-square`;
const href = `https://github.com/${repo.owner}/${repo.name}/blob/${branch}/${value}`;
return [badgeSrc, href];
Expand Down Expand Up @@ -189,7 +189,7 @@ function getGithubRepoBadge(repo: Repo): [string, string] {
const badgeColor = "gray";
const badgeSrc = `https://img.shields.io/badge/-${badgeValue}-${badgeColor}?style=flat-square&logo=github`;

const branch = repo.mainBranch ?? "main";
const branch = repo.defaultBranch ?? "main";
const subPathUrlSuffix = repo.subPath ? `/tree/${branch}/${repo.subPath}` : "";
const href = `https://github.com/${repo.owner}/${repo.name}${subPathUrlSuffix}`;

Expand Down
Loading