Skip to content

plugin-exec

@bonvoy/plugin-exec — Optional plugin

Run custom shell commands at any point in the release lifecycle.

Installation

bash
npm install -D @bonvoy/plugin-exec

Usage

javascript
export default {
  plugins: [
    ['@bonvoy/plugin-exec', {
      beforePublish: 'npm run build',
      afterRelease: 'echo "Released!"',
    }]
  ],
};

Available Hooks

HookWhen
beforeShipItBefore release starts
afterVersionAfter versions are bumped
beforeChangelogBefore changelog generation
afterChangelogAfter changelog is written
beforePublishBefore npm publish
afterPublishAfter npm publish
beforeReleaseBefore GitHub/GitLab release
afterReleaseAfter release completes

Examples

Build before publish

javascript
export default {
  plugins: [
    ['@bonvoy/plugin-exec', {
      beforePublish: 'npm run build',
    }]
  ],
};

Run tests and build

javascript
export default {
  plugins: [
    ['@bonvoy/plugin-exec', {
      beforePublish: 'npm run lint && npm run build && npm run test',
    }]
  ],
};

Send a webhook

javascript
export default {
  plugins: [
    ['@bonvoy/plugin-exec', {
      afterRelease: 'curl -X POST https://hooks.example.com/release -d "done"',
    }]
  ],
};

Behavior

  • Commands run with full shell support (pipes, redirects, &&, etc.)
  • Commands are skipped in dry-run mode
  • Commands are logged before execution
  • If a command fails, the release process stops

Released under the MIT License.