MCPcopy Index your code
hub / github.com/dmno-dev/bumpy / ciSetupCommand

Function ciSetupCommand

packages/bumpy/src/commands/ci-setup.ts:14–60  ·  view source on GitHub ↗
(rootDir: string)

Source from the content-addressed store, hash-verified

12];
13
14export async function ciSetupCommand(rootDir: string): Promise<void> {
15 p.intro(pc.bgCyan(pc.black(' bumpy ci setup ')));
16
17 // Detect repo and package manager context
18 const repo = detectRepo(rootDir);
19 if (!repo) {
20 log.error(
21 'Could not detect a GitHub repository.\n' +
22 ' This command currently only supports GitHub-hosted repos.\n' +
23 ' Make sure you have a GitHub remote (git remote -v).',
24 );
25 process.exit(1);
26 }
27 const pm = await detectPackageManager(rootDir);
28
29 p.log.info(`Detected repository: ${pc.cyan(repo)}`);
30 p.log.info('');
31 p.log.info(
32 'To trigger CI checks on the version PR, bumpy needs a token\n' +
33 "that bypasses GitHub's default anti-recursion guard.\n" +
34 'You can use a fine-grained PAT or a GitHub App installation token.',
35 );
36
37 const method = unwrap(
38 await p.select({
39 message: 'How would you like to authenticate?',
40 options: [
41 {
42 label: 'Fine-grained Personal Access Token (PAT)',
43 value: 'pat' as const,
44 hint: 'recommended — quick and simple',
45 },
46 {
47 label: 'GitHub App installation token',
48 value: 'app' as const,
49 hint: 'advanced — not tied to a personal account',
50 },
51 ],
52 }),
53 );
54
55 if (method === 'pat') {
56 await setupPat(rootDir, repo, pm);
57 } else {
58 await setupApp(rootDir, repo, pm);
59 }
60}
61
62// ---- PAT flow ----
63

Callers 1

mainFunction · 0.85

Calls 5

detectPackageManagerFunction · 0.90
unwrapFunction · 0.90
setupPatFunction · 0.85
setupAppFunction · 0.85
detectRepoFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…