MCPcopy Create free account
hub / github.com/code-pushup/cli / generateGitHubYaml

Function generateGitHubYaml

packages/create-cli/src/lib/setup/ci.ts:58–95  ·  view source on GitHub ↗
({
  mode,
  tool,
}: ConfigContext)

Source from the content-addressed store, hash-verified

56}
57
58async function generateGitHubYaml({
59 mode,
60 tool,
61}: ConfigContext): Promise<string> {
62 const branch = await getGitDefaultBranch();
63 const lines = [
64 'name: Code PushUp',
65 '',
66 'on:',
67 ' push:',
68 ` branches: [${branch}]`,
69 ' pull_request:',
70 ` branches: [${branch}]`,
71 '',
72 'permissions:',
73 ' contents: read',
74 ' actions: read',
75 ' pull-requests: write',
76 '',
77 'jobs:',
78 ' code-pushup:',
79 ' runs-on: ubuntu-latest',
80 ' name: Code PushUp',
81 ' steps:',
82 ' - name: Clone repository',
83 ' uses: actions/checkout@v5',
84 ' - name: Set up Node.js',
85 ' uses: actions/setup-node@v6',
86 ' - name: Install dependencies',
87 ' run: npm ci',
88 ' - name: Code PushUp',
89 ' uses: code-pushup/github-action@v0',
90 ...(mode === 'monorepo' && tool != null
91 ? [' with:', ` monorepo: ${tool}`]
92 : []),
93 ];
94 return `${lines.join('\n')}\n`;
95}
96
97async function writeGitLabConfig(tree: Tree): Promise<void> {
98 const filePath = await resolveGitLabFilePath(tree);

Callers 1

writeGitHubWorkflowFunction · 0.85

Calls 1

getGitDefaultBranchFunction · 0.90

Tested by

no test coverage detected