@secureci/cli 1.0.1 → 1.1.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.
@@ -144,7 +144,7 @@ async function executeNodeAction(action, actionPath, step, actionInputs, callerC
144
144
  }
145
145
  try {
146
146
  const { stdout, stderr } = await execFileAsync(node.path, [path.join(actionDir, script)], {
147
- cwd: process.cwd(),
147
+ cwd: runtime.workspace,
148
148
  maxBuffer: 64 * 1024 * 1024,
149
149
  timeout: limit.ms,
150
150
  killSignal: 'SIGKILL',
@@ -38,6 +38,7 @@ exports.createStepFiles = createStepFiles;
38
38
  exports.readStepFiles = readStepFiles;
39
39
  exports.cleanupStepFiles = cleanupStepFiles;
40
40
  exports.processWorkflowCommands = processWorkflowCommands;
41
+ exports.runnerArch = runnerArch;
41
42
  exports.buildRunnerEnv = buildRunnerEnv;
42
43
  exports.prependPath = prependPath;
43
44
  exports.hostBaseEnv = hostBaseEnv;
@@ -248,6 +249,24 @@ function runnerOs() {
248
249
  return 'Linux';
249
250
  }
250
251
  }
252
+ /**
253
+ * `RUNNER_ARCH` / `runner.arch` for a Node.js architecture, using GitHub's
254
+ * values (X86, X64, ARM, ARM64). Jobs run natively (a job container has the
255
+ * host's architecture), so the host's is the runner's. Anything else reports
256
+ * X64, as before this was mapped.
257
+ */
258
+ function runnerArch(arch = process.arch) {
259
+ switch (arch) {
260
+ case 'arm64':
261
+ return 'ARM64';
262
+ case 'arm':
263
+ return 'ARM';
264
+ case 'ia32':
265
+ return 'X86';
266
+ default:
267
+ return 'X64';
268
+ }
269
+ }
251
270
  /**
252
271
  * The default environment variables GitHub's runner exports to every step,
253
272
  * derived from the (local, best-effort) `github` context.
@@ -274,6 +293,7 @@ function buildRunnerEnv(github, options) {
274
293
  GITHUB_WORKSPACE: options.workspace,
275
294
  GITHUB_EVENT_PATH: options.eventPath,
276
295
  RUNNER_OS: runnerOs(),
296
+ RUNNER_ARCH: runnerArch(),
277
297
  RUNNER_TEMP: options.tempDir,
278
298
  RUNNER_TOOL_CACHE: options.toolCache
279
299
  };
@@ -143,8 +143,8 @@ async function executeStep(step, options, runtime, ctx) {
143
143
  timeout: limit.ms,
144
144
  killSignal: 'SIGKILL',
145
145
  cwd: workingDirectory
146
- ? path.resolve(process.cwd(), workingDirectory)
147
- : process.cwd(),
146
+ ? path.resolve(runtime.workspace, workingDirectory)
147
+ : runtime.workspace,
148
148
  env: {
149
149
  ...(0, runner_env_1.hostBaseEnv)(),
150
150
  ...runtime.runnerEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secureci/cli",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "SecureCI: validate, check against pipeline standards, and run GitHub Actions workflows locally",
5
5
  "main": "dist/index.js",
6
6
  "bin": {