Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 1 | import type { Route } from "./+types/secrets"; |
| Social cards for every page: og.g1t.sh | 2 | import { page } from "../../lib/meta"; |
| Project settings move into the sidebar, grouped, with a heading per page | 3 | import { RepoSettingsHeading } from "../../components/repo-settings-heading"; |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 4 | import { SecretsPanel } from "../../components/secrets"; |
| 5 | import { actOnSecrets, loadSecrets } from "../../lib/secrets.server"; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 6 | import { assertSameOrigin, requireUser } from "../../lib/session.server"; |
| 7 | import { requireCapability, requireInsider } from "../../lib/access.server"; | |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 8 | |
| Social cards for every page: og.g1t.sh | 9 | export function meta({ params, ...args }: Route.MetaArgs) { |
| 10 | return page(args, { title: `Secrets and variables · ${params.owner}/${params.repo} · g1t` }); | |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 11 | } |
| 12 | ||
| 13 | const ownerOf = (params: { owner: string; repo: string }) => ({ repo: { namespace: params.owner, name: params.repo } }); | |
| 14 | ||
| 15 | export async function loader({ params, context, request }: Route.LoaderArgs) { | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 16 | // Admins; to anyone without a role here the page does not exist. |
| 17 | await requireInsider(context, params, "manage_integrations"); | |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 18 | return loadSecrets(ownerOf(params), requireUser(context, request)); |
| 19 | } | |
| 20 | ||
| 21 | export async function action({ request, params, context }: Route.ActionArgs) { | |
| 22 | assertSameOrigin(request); | |
| 23 | const user = requireUser(context, request); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 24 | await requireCapability(context, params, "manage_integrations"); |
| Secrets and variables: one list, rows per environment, for workflows and deployments | 25 | const page = `/${params.owner}/${params.repo}/settings/secrets`; |
| 26 | return actOnSecrets(ownerOf(params), user, await request.formData(), page); | |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 27 | } |
| 28 | ||
| 29 | export default function RepoSecrets({ loaderData, actionData, params }: Route.ComponentProps) { | |
| 30 | return ( | |
| 31 | <div> | |
| Project settings move into the sidebar, grouped, with a heading per page | 32 | <RepoSettingsHeading base={`/${params.owner}/${params.repo}`} /> |
| Projects: what a workspace builds and runs, first on every page | 33 | <SecretsPanel data={loaderData} action={actionData} scope="project" manage /> |
| GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs | 34 | </div> |
| 35 | ); | |
| 36 | } |