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.
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 1 | /** |
| 2 | * "Set up code scanning": commits the starter workflow on a new branch as | |
| 3 | * the person asking and opens it as their pull request, then goes to it. | |
| 4 | * It changes the repository's workflows: Maintain, as settings do. | |
| 5 | */ | |
| 6 | import { redirect } from "react-router"; | |
| 7 | ||
| 8 | import type { Route } from "./+types/security-code-setup"; | |
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 9 | import { refusal } from "../../lib/access.server"; |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 10 | import { setupCodeScanning } from "../../lib/security-suite.server"; |
| 11 | import { assertSameOrigin, requireUser } from "../../lib/session.server"; | |
| 12 | ||
| 13 | export async function action({ request, params, context }: Route.ActionArgs) { | |
| 14 | assertSameOrigin(request); | |
| 15 | const user = requireUser(context, request); | |
| 16 | const refused = await refusal(context, params, "manage_settings"); | |
| 17 | if (refused) return { error: refused }; | |
| 18 | const opened = await setupCodeScanning(user, { namespace: params.owner, name: params.repo }); | |
| 19 | if (!opened.ok) return { error: opened.message }; | |
| 20 | throw redirect(`/${params.owner}/${params.repo}/pull/${opened.number}`); | |
| 21 | } | |
| 22 | ||
| 23 | export async function loader({ params }: Route.LoaderArgs) { | |
| 24 | throw redirect(`/${params.owner}/${params.repo}/security/code-scanning`); | |
| 25 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.