@argos-ci/core 2.4.2-alpha.6 → 2.5.0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -14
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -48,7 +48,7 @@ import { createRequire } from 'node:module';
48
48
  function getMergeBaseCommitShaWithDepth(input) {
49
49
  const head = input.head || `HEAD`;
50
50
  try {
51
- execSync(`git fetch origin ${head} --depth ${input.depth}`);
51
+ execSync(`git fetch origin ${head}:${head} --depth ${input.depth}`);
52
52
  execSync(`git fetch origin ${input.base}:${input.base} --depth ${input.depth}`);
53
53
  const mergeBase = execSync(`git merge-base ${head} ${input.base}`).toString().trim();
54
54
  return mergeBase || null;
@@ -60,8 +60,8 @@ function getMergeBaseCommitSha$1(input) {
60
60
  let depth = 50;
61
61
  while(depth < 1000){
62
62
  const mergeBase = getMergeBaseCommitShaWithDepth({
63
- ...input,
64
- depth
63
+ depth,
64
+ ...input
65
65
  });
66
66
  if (mergeBase) {
67
67
  return mergeBase;
@@ -273,16 +273,7 @@ const service$4 = {
273
273
  prHeadCommit: payload?.pull_request?.head.sha ?? null
274
274
  };
275
275
  },
276
- getMergeBaseCommitSha: (input, ctx)=>{
277
- const payload = readEventPayload(ctx);
278
- const branch = getBranch(ctx, payload);
279
- // Unshallow the repository to get the merge base commit
280
- execSync(`git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"`);
281
- return getMergeBaseCommitSha$1({
282
- base: input.base,
283
- head: branch
284
- });
285
- }
276
+ getMergeBaseCommitSha: getMergeBaseCommitSha$1
286
277
  };
287
278
 
288
279
  const getPrNumber$1 = ({ env })=>{
@@ -893,7 +884,8 @@ async function uploadFilesToS3(files) {
893
884
  return null;
894
885
  }
895
886
  const sha = getMergeBaseCommitSha({
896
- base: referenceBranch
887
+ base: referenceBranch,
888
+ head: config.branch
897
889
  });
898
890
  if (sha) {
899
891
  debug("Found reference commit from git", sha);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/core",
3
3
  "description": "Visual testing solution to avoid visual regression. The core component of Argos SDK that handles build creation.",
4
- "version": "2.4.2-alpha.6+6b6c15f",
4
+ "version": "2.5.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "types": "./dist/index.d.ts",
@@ -40,8 +40,8 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@argos-ci/api-client": "0.1.1-alpha.34+6b6c15f",
44
- "@argos-ci/util": "2.1.1-alpha.14+6b6c15f",
43
+ "@argos-ci/api-client": "0.2.0",
44
+ "@argos-ci/util": "2.1.1",
45
45
  "axios": "^1.7.4",
46
46
  "convict": "^6.2.4",
47
47
  "debug": "^4.3.6",
@@ -60,5 +60,5 @@
60
60
  "build": "rollup -c",
61
61
  "e2e": "node ./e2e/upload.cjs && node ./e2e/upload.mjs"
62
62
  },
63
- "gitHead": "6b6c15f62882eb38e36a59f80f5ad2aa6d7ee3ff"
63
+ "gitHead": "4ca78028dd9d50f8c076ca498ea3a0b284ff4934"
64
64
  }