@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.
- package/README.md +20 -11
- package/dist/advisories.js +33 -6
- package/dist/cli.js +46 -1
- package/dist/config.js +12 -1
- package/dist/org-scan-script.js +6 -0
- package/dist/org-scan.js +88 -0
- package/dist/parser/pipeline-contract-validator.js +56 -25
- package/dist/runner/action-fetcher.js +6 -1
- package/dist/runner/actions.js +7 -7
- package/dist/runner/checkout.js +124 -8
- package/dist/runner/container-policy.js +32 -0
- package/dist/runner/docker-action.js +1 -1
- package/dist/runner/executor.js +28 -6
- package/dist/runner/expression.js +125 -3
- package/dist/runner/job-container.js +57 -11
- package/dist/runner/job-runtime.js +4 -3
- package/dist/runner/node-action.js +1 -1
- package/dist/runner/runner-env.js +20 -0
- package/dist/runner/steps.js +2 -2
- package/package.json +1 -1
|
@@ -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:
|
|
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
|
};
|
package/dist/runner/steps.js
CHANGED
|
@@ -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(
|
|
147
|
-
:
|
|
146
|
+
? path.resolve(runtime.workspace, workingDirectory)
|
|
147
|
+
: runtime.workspace,
|
|
148
148
|
env: {
|
|
149
149
|
...(0, runner_env_1.hostBaseEnv)(),
|
|
150
150
|
...runtime.runnerEnv,
|