({
mode,
tool,
}: ConfigContext)
| 56 | } |
| 57 | |
| 58 | async 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 | |
| 97 | async function writeGitLabConfig(tree: Tree): Promise<void> { |
| 98 | const filePath = await resolveGitLabFilePath(tree); |
no test coverage detected