()
| 104 | } |
| 105 | |
| 106 | function generateGitLabYaml(): string { |
| 107 | const lines = [ |
| 108 | 'workflow:', |
| 109 | ' rules:', |
| 110 | ' - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH', |
| 111 | " - if: $CI_PIPELINE_SOURCE == 'merge_request_event'", |
| 112 | '', |
| 113 | 'include:', |
| 114 | ' - https://gitlab.com/code-pushup/gitlab-pipelines-template/-/raw/latest/code-pushup.yml', |
| 115 | ]; |
| 116 | return `${lines.join('\n')}\n`; |
| 117 | } |
| 118 | |
| 119 | async function patchRootGitLabConfig(tree: Tree): Promise<void> { |
| 120 | const content = await tree.read(GITLAB_CONFIG_PATH); |