Skip to content
26 linesCodeBlameRaw

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 bar1/**
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 */
6import { redirect } from "react-router";
7
8import type { Route } from "./+types/security-code-setup";
A desktop release goes out with what can be built. Linux is built on g1t's machines in every release; Windows and macOS each wait on a repository variable: a machine registered for them, or for Windows a cross build on Linux once aka.ms and download.visualstudio.microsoft.com are workflow-only domains, which is where the first release stopped. A platform with no machine is skipped and the download page says it is coming, with a word for the visitor whose platform this release lacks. The guide and CONTRIBUTING say so.9import { refusal, requireWritableRepo } from "../../lib/access.server";
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar10import { setupCodeScanning } from "../../lib/security-suite.server";
11import { assertSameOrigin, requireUser } from "../../lib/session.server";
12
13export async function action({ request, params, context }: Route.ActionArgs) {
14 assertSameOrigin(request);
15 const user = requireUser(context, request);
A desktop release goes out with what can be built. Linux is built on g1t's machines in every release; Windows and macOS each wait on a repository variable: a machine registered for them, or for Windows a cross build on Linux once aka.ms and download.visualstudio.microsoft.com are workflow-only domains, which is where the first release stopped. A platform with no machine is skipped and the download page says it is coming, with a word for the visitor whose platform this release lacks. The guide and CONTRIBUTING say so.16 await requireWritableRepo(context, params);
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar17 const refused = await refusal(context, params, "manage_settings");
18 if (refused) return { error: refused };
19 const opened = await setupCodeScanning(user, { namespace: params.owner, name: params.repo });
20 if (!opened.ok) return { error: opened.message };
21 throw redirect(`/${params.owner}/${params.repo}/pull/${opened.number}`);
22}
23
24export async function loader({ params }: Route.LoaderArgs) {
25 throw redirect(`/${params.owner}/${params.repo}/security/code-scanning`);
26}