@argos-ci/core 6.2.0 → 6.2.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.
Files changed (2) hide show
  1. package/dist/index.mjs +25 -5
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import convict from "convict";
3
- import { execSync } from "node:child_process";
3
+ import { execFileSync, execSync } from "node:child_process";
4
4
  import createDebug from "debug";
5
5
  import { createReadStream, existsSync, readFileSync } from "node:fs";
6
6
  import { readFile, stat } from "node:fs/promises";
@@ -72,7 +72,11 @@ function getRepositoryURL() {
72
72
  */
73
73
  function gitMergeBase(input) {
74
74
  try {
75
- return execSync(`git merge-base ${input.head} ${input.base}`).toString().trim();
75
+ return execFileSync("git", [
76
+ "merge-base",
77
+ input.head,
78
+ input.base
79
+ ]).toString().trim();
76
80
  } catch (error) {
77
81
  if (checkIsExecError(error) && error.status === 1 && error.stderr.toString() === "") return null;
78
82
  throw error;
@@ -82,7 +86,15 @@ function gitMergeBase(input) {
82
86
  * Run git fetch with a specific ref and depth.
83
87
  */
84
88
  function gitFetch(input) {
85
- execSync(`git fetch --force --update-head-ok --depth ${input.depth} origin ${input.ref}:${input.target}`);
89
+ execFileSync("git", [
90
+ "fetch",
91
+ "--force",
92
+ "--update-head-ok",
93
+ "--depth",
94
+ String(input.depth),
95
+ "origin",
96
+ `${input.ref}:${input.target}`
97
+ ]);
86
98
  }
87
99
  /**
88
100
  * Check if an error is an exec error that includes stderr.
@@ -127,12 +139,20 @@ function getMergeBaseCommitSha$1(input) {
127
139
  return null;
128
140
  }
129
141
  function listShas(path, maxCount) {
130
- return execSync(`git log --format="%H" ${maxCount ? `--max-count=${maxCount}` : ""} ${path}`.trim()).toString().trim().split("\n");
142
+ const args = ["log", "--format=%H"];
143
+ if (maxCount) args.push(`--max-count=${maxCount}`);
144
+ args.push(path);
145
+ return execFileSync("git", args).toString().trim().split("\n");
131
146
  }
132
147
  function listParentCommits$1(input) {
133
148
  const limit = 200;
134
149
  try {
135
- execSync(`git fetch --depth=${limit} origin ${input.sha}`);
150
+ execFileSync("git", [
151
+ "fetch",
152
+ `--depth=${limit}`,
153
+ "origin",
154
+ input.sha
155
+ ]);
136
156
  } catch (error) {
137
157
  if (error instanceof Error && error.message.includes("not our ref")) return [];
138
158
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/core",
3
3
  "description": "Node.js SDK for visual testing with Argos.",
4
- "version": "6.2.0",
4
+ "version": "6.2.1",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -45,8 +45,8 @@
45
45
  "debug": "^4.4.3",
46
46
  "fast-glob": "^3.3.3",
47
47
  "mime-types": "^3.0.2",
48
- "sharp": "^0.34.5",
49
- "tmp": "^0.2.5"
48
+ "sharp": "^0.35.2",
49
+ "tmp": "^0.2.7"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@octokit/webhooks": "^14.2.0",
@@ -67,5 +67,5 @@
67
67
  "lint": "eslint .",
68
68
  "test": "vitest"
69
69
  },
70
- "gitHead": "1787fe78cba46f408493e02114150f2d73f47fa4"
70
+ "gitHead": "b9d109dc1fa7d98c4fc2cafac2e310fc22b63c43"
71
71
  }