
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@actions/exec
Advanced tools
@actions/execYou can use this package to execute tools in a cross platform way:
const exec = require('@actions/exec');
await exec.exec('node index.js');
You can also pass in arg arrays:
const exec = require('@actions/exec');
await exec.exec('node', ['index.js', 'foo=bar']);
Capture output or specify other options:
const exec = require('@actions/exec');
let myOutput = '';
let myError = '';
const options = {};
options.listeners = {
stdout: (data: Buffer) => {
myOutput += data.toString();
},
stderr: (data: Buffer) => {
myError += data.toString();
}
};
options.cwd = './lib';
await exec.exec('node', ['index.js', 'foo=bar'], options);
You can specify the full path for tools not in the PATH:
const exec = require('@actions/exec');
await exec.exec('"/path/to/my-tool"', ['arg1']);
The 'child_process' module is a built-in Node.js module that provides the ability to spawn child processes. It offers similar functionalities to @actions/exec, such as executing shell commands and capturing their output. However, it is more low-level and requires more boilerplate code to achieve the same tasks.
ShellJS is a popular npm package that provides portable Unix shell commands for Node.js. It offers a higher-level API compared to 'child_process' and includes additional utilities for file system operations. While it is not specifically designed for GitHub Actions, it can be used to achieve similar command execution functionalities.
Execa is a modern npm package for executing shell commands in Node.js. It provides a promise-based API, better error handling, and more features compared to 'child_process'. Execa is a good alternative to @actions/exec for general-purpose command execution in Node.js applications.
FAQs
Actions exec lib
The npm package @actions/exec receives a total of 3,681,861 weekly downloads. As such, @actions/exec popularity was classified as popular.
We found that @actions/exec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.