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

Function createRunEnv

packages/ci/src/lib/run-utils.ts:88–108  ·  view source on GitHub ↗
(
  refs: GitRefs,
  api: ProviderAPIClient,
  options: Options | undefined,
  git: SimpleGit,
)

Source from the content-addressed store, hash-verified

86};
87
88export async function createRunEnv(
89 refs: GitRefs,
90 api: ProviderAPIClient,
91 options: Options | undefined,
92 git: SimpleGit,
93): Promise<RunEnv> {
94 const [head, base] = await Promise.all([
95 normalizeGitRef(refs.head, git),
96 refs.base && normalizeGitRef(refs.base, git),
97 ]);
98
99 return {
100 refs: { head, ...(base && { base }) },
101 api,
102 settings: {
103 ...DEFAULT_SETTINGS,
104 ...(options && sanitizeOptions(options)),
105 },
106 git,
107 };
108}
109
110function sanitizeOptions(options: Options): Options {
111 return removeUndefinedAndEmptyProps({

Callers 1

runInCIFunction · 0.85

Calls 2

normalizeGitRefFunction · 0.85
sanitizeOptionsFunction · 0.85

Tested by

no test coverage detected