1.1.1 • Published 3 years ago

@actions/exec v1.1.1

Weekly downloads
71,473
License
MIT
Repository
github
Last release
3 years ago

@actions/exec

Usage

Basic

You can use this package to execute tools in a cross platform way:

const exec = require('@actions/exec');

await exec.exec('node index.js');

Args

You can also pass in arg arrays:

const exec = require('@actions/exec');

await exec.exec('node', ['index.js', 'foo=bar']);

Output/options

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);

Exec tools not in the PATH

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']);
github-actions-kit@airvzxf/cache@njmaeff/publish-devtodo-it-yourself@hediet/npm-template@crazymax/actions-toolkitgithub-pr-collector@everything-registry/sub-chunk-26synopsys-sig-nodetest-github_actions_testworkflow-status-slack-notificationsupar-bit-releasestore-git-credential-github-actionstartgptcommittest-synopsys-sig-nodetheguruvisualize-repo@dotcom-tool-kit/npm@docker/actions-toolkit@cypress/github-action@deuscx/issue-blog-action@cpany/action@cpany/cli@peter-evans/actions-gitjest-coverage-comment-actionjest-github-actionk8s-deploy-actioninstall-swift-tooljavascript-actionnpm-semantic-publish-actionupload_file_to_releasesqlproj-analysis-clitool-cache-mirror@atom-ide-community/setup-atom@autoblocks/cli@akiojin/generate-mac-installer-github-action@akiojin/git-credential-manager-helper@akiojin/keychain@akiojin/p4-command@akiojin/setup-xocde-environment-github-action@akiojin/unity-bulid-github-action@alexkeating/nx-subgraph@bamboostick/git_release_notes@breeffy/actions-toolkit@busyxiang/react-hook-collection@chkimes/actions-cache@actions/cache@actions/core@actions/tool-cache@actions-for-rust/core@actions-kit/exec@boilerz/action-releaseunity-command-github-action@harveyr/github-actions-kit@hediet/json-to-dictionary@hediet/semver@hiberbee/github-actions@fluffy-spoon/action@google-github-actions/setup-cloud-sdk@gperdomor/nx-tools-core@gperdomor/nx-tools-nx-docker@eslint/github-action@khoazero123/actions-toolkit-cache@lui-design/coverage-report@martijnhols/actions-cache@njmaeff/publish-devto-lib@enescakir/cache@emtux/actions@justia/releaser@iota/gh-tangle-release@jamesives/github-pages-deploy-action@jonabc/actions-mocks@khulnasoft/github-action@kie/build-chain-action@kmfb/opencommit@jcroall/synopsys-sig-node@kamranahmedse/github-pages-blog-action@kengotoda/actions-setup-docker-compose@kcws/github-actions@octopusdeploy/step-package-cli@octorelease/git@octorelease/lerna@octorelease/npm@octorelease/prune-shrinkwrap@octorelease/sample-plugin@octorelease/core@ptabor/github-actions@rabbitcc/actions@rehearsal/action@rinse-repeat/actions-rs-core@ones-design/coverage-report@nx-tools/core@nx-tools/docker-meta@nx-extensions/core@peergrade/actions-common-scans@shelfjs/schematics@skifree/expo-github-action@sliit-foss/actions-exec-wrapper@sliit-foss/automatic-versioning@rocket.chat/houston
1.1.1

3 years ago

1.1.0

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago