@xcelera/cli 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/action.js CHANGED
@@ -36511,7 +36511,7 @@ var simpleGit = gitInstanceFactory;
36511
36511
 
36512
36512
  async function inferGitContext() {
36513
36513
  if (!(await isGitRepository())) {
36514
- throw new Error('No git repository detected.');
36514
+ return undefined;
36515
36515
  }
36516
36516
  const remoteUrl = await getRemoteUrl();
36517
36517
  const parsed = parseGithubUrl(remoteUrl);
@@ -36561,17 +36561,15 @@ async function getCommit(hash = 'HEAD') {
36561
36561
 
36562
36562
  async function inferBuildContext() {
36563
36563
  const ciEnv = envCi();
36564
- const gitContext = {
36565
- ...(await inferGitContext()),
36566
- branch: ('prBranch' in ciEnv && ciEnv.prBranch ? ciEnv.prBranch : ciEnv.branch) ??
36567
- undefined
36568
- };
36564
+ const gitContext = await inferGitContext();
36565
+ const branch = ('prBranch' in ciEnv && ciEnv.prBranch ? ciEnv.prBranch : ciEnv.branch) ??
36566
+ undefined;
36569
36567
  return {
36570
36568
  service: ciEnv.isCi ? ciEnv.service : 'unknown',
36571
36569
  prNumber: 'pr' in ciEnv ? ciEnv.pr : undefined,
36572
36570
  buildNumber: 'build' in ciEnv ? ciEnv.build : undefined,
36573
36571
  buildUrl: 'buildUrl' in ciEnv ? ciEnv.buildUrl : undefined,
36574
- git: gitContext
36572
+ git: gitContext ? { ...gitContext, branch } : undefined
36575
36573
  };
36576
36574
  }
36577
36575