Skip to content

Commit

Permalink
fix(config): fix config resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Feb 2, 2024
1 parent 47e8134 commit fa9a521
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,30 +154,30 @@ export async function readConfig(options: Partial<Config> = {}) {
const ciEnv = await getCiEnvironment();

config.load({
apiBaseUrl: options.apiBaseUrl ?? config.get("apiBaseUrl"),
commit: options.commit ?? config.get("commit") ?? ciEnv?.commit ?? null,
branch: options.branch ?? config.get("branch") ?? ciEnv?.branch ?? null,
token: options.token ?? config.get("token") ?? null,
buildName: options.buildName ?? config.get("buildName") ?? null,
apiBaseUrl: options.apiBaseUrl || config.get("apiBaseUrl"),
commit: options.commit || config.get("commit") || ciEnv?.commit || null,
branch: options.branch || config.get("branch") || ciEnv?.branch || null,
token: options.token || config.get("token") || null,
buildName: options.buildName || config.get("buildName") || null,
prNumber:
options.prNumber ?? config.get("prNumber") ?? ciEnv?.prNumber ?? null,
prHeadCommit: config.get("prHeadCommit") ?? ciEnv?.prHeadCommit ?? null,
options.prNumber || config.get("prNumber") || ciEnv?.prNumber || null,
prHeadCommit: config.get("prHeadCommit") || ciEnv?.prHeadCommit || null,
referenceBranch:
options.referenceBranch ?? config.get("referenceBranch") ?? null,
options.referenceBranch || config.get("referenceBranch") || null,
referenceCommit:
options.referenceCommit ?? config.get("referenceCommit") ?? null,
ciService: ciEnv?.name ?? null,
owner: ciEnv?.owner ?? null,
repository: ciEnv?.repository ?? null,
jobId: ciEnv?.jobId ?? null,
runId: ciEnv?.runId ?? null,
options.referenceCommit || config.get("referenceCommit") || null,
ciService: ciEnv?.name || null,
owner: ciEnv?.owner || null,
repository: ciEnv?.repository || null,
jobId: ciEnv?.jobId || null,
runId: ciEnv?.runId || null,
parallel: options.parallel ?? config.get("parallel") ?? false,
parallelNonce:
options.parallelNonce ??
config.get("parallelNonce") ??
ciEnv?.nonce ??
options.parallelNonce ||
config.get("parallelNonce") ||
ciEnv?.nonce ||
null,
parallelTotal: options.parallelTotal ?? config.get("parallelTotal") ?? null,
parallelTotal: options.parallelTotal || config.get("parallelTotal") || null,
});

config.validate();
Expand Down

0 comments on commit fa9a521

Please sign in to comment.