diff --git a/app/(main)/[owner]/[repo]/[branch]/actions/page.tsx b/app/(main)/[owner]/[repo]/[branch]/actions/page.tsx
new file mode 100644
index 000000000..bd5825da2
--- /dev/null
+++ b/app/(main)/[owner]/[repo]/[branch]/actions/page.tsx
@@ -0,0 +1,81 @@
+"use client";
+
+import { ActionsPage } from "@/components/actions/actions-page";
+import { DocumentTitle, formatRepoBranchTitle } from "@/components/document-title";
+import { useConfig } from "@/contexts/config-context";
+import { useUser } from "@/contexts/user-context";
+import { hasGithubIdentity } from "@/lib/authz";
+import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
+import { getRootActions, getSchemaActions } from "@/lib/repo-actions";
+
+export default function Page() {
+ const { config } = useConfig();
+ const { user } = useUser();
+
+ if (!config) throw new Error("Configuration not found.");
+
+ if (!hasGithubIdentity(user)) {
+ return (
+
+
+ Access denied
+ Only GitHub users can view action history.
+
+
+ );
+ }
+
+ const actionLabels = {
+ ...Object.fromEntries(getRootActions(config.object).map((action) => [action.name, action.label])),
+ ...Object.fromEntries(
+ ((config.object as any).content ?? []).flatMap((item: any) =>
+ getSchemaActions(item).concat(getSchemaActions(item, "collection"), getSchemaActions(item, "entry"))
+ .map((action) => [action.name, action.label] as const),
+ ),
+ ),
+ ...Object.fromEntries(
+ ((config.object as any).media ?? []).flatMap((item: any) =>
+ ((item.actions ?? []) as Array<{ name: string; label: string }>).map((action) => [action.name, action.label] as const),
+ ),
+ ),
+ };
+
+ const contextLabels = {
+ ...Object.fromEntries(
+ ((config.object as any).content ?? []).flatMap((item: any) => {
+ const label = item.label || item.name;
+ if (item.type === "collection") {
+ return [
+ [`collection:${item.name}`, label] as const,
+ [`entry:${item.name}`, label] as const,
+ ];
+ }
+
+ return [[`file:${item.name}`, label] as const];
+ }),
+ ),
+ ...Object.fromEntries(
+ ((config.object as any).media ?? []).map((item: any) => [
+ `media:${item.name}`,
+ item.label || item.name,
+ ]),
+ ),
+ };
+
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
diff --git a/app/(main)/[owner]/[repo]/[branch]/layout.tsx b/app/(main)/[owner]/[repo]/[branch]/layout.tsx
index 4fbb4de20..5ac0ca819 100644
--- a/app/(main)/[owner]/[repo]/[branch]/layout.tsx
+++ b/app/(main)/[owner]/[repo]/[branch]/layout.tsx
@@ -67,7 +67,7 @@ export default async function Layout({
{`The branch "${decodedBranch}" could not be found. It may have been removed or renamed.`}
-
+
Open default branch
@@ -82,7 +82,7 @@ export default async function Layout({
You do not have permission to access this repository.
-
+
Choose another repository
diff --git a/app/(main)/[owner]/[repo]/[branch]/page.tsx b/app/(main)/[owner]/[repo]/[branch]/page.tsx
index ed12de476..824bdc228 100644
--- a/app/(main)/[owner]/[repo]/[branch]/page.tsx
+++ b/app/(main)/[owner]/[repo]/[branch]/page.tsx
@@ -38,7 +38,7 @@ export default function Page() {
Edit configuration on GitHub
diff --git a/app/(main)/[owner]/[repo]/layout.tsx b/app/(main)/[owner]/[repo]/layout.tsx
index 3d08688e3..4fa29a3e9 100644
--- a/app/(main)/[owner]/[repo]/layout.tsx
+++ b/app/(main)/[owner]/[repo]/layout.tsx
@@ -43,7 +43,7 @@ export default async function Layout({
Create a branch and add a ".pages.yml" file to configure this repository.
-
+
Choose another repository
@@ -71,7 +71,7 @@ export default async function Layout({
It may have been removed, renamed, or the URL may be incorrect.
-
+
Choose another repository
@@ -85,7 +85,7 @@ export default async function Layout({
You do not have permission to access this repository.
-
+
Choose another repository
diff --git a/app/(main)/[owner]/[repo]/page.tsx b/app/(main)/[owner]/[repo]/page.tsx
index 4b37839b8..fc46654d4 100644
--- a/app/(main)/[owner]/[repo]/page.tsx
+++ b/app/(main)/[owner]/[repo]/page.tsx
@@ -3,16 +3,10 @@
import { useEffect } from "react";
import { useRouter } from "next/navigation";
import { useRepo } from "@/contexts/repo-context";
-import { useUser } from "@/contexts/user-context";
export default function Page() {
const { owner, repo, defaultBranch } = useRepo();
const router = useRouter();
- const { user } = useUser();
-
- if (!user) throw new Error("User not found");
- if (!user.accounts) throw new Error("Accounts not found");
- if (!user.accounts.find((account) => account.login.toLowerCase() === owner.toLowerCase())) throw new Error(`GitHub application not installed for "${owner}"`);
useEffect(() => {
// If no branch is provided, redirect to the default branch
@@ -20,4 +14,4 @@ export default function Page() {
}, [owner, repo, defaultBranch, router]);
return null;
-};
\ No newline at end of file
+};
diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx
index 109773535..9245ae31a 100644
--- a/app/(main)/page.tsx
+++ b/app/(main)/page.tsx
@@ -74,7 +74,7 @@ export default function Page() {