{"id":13657411,"url":"https://github.com/semantic-release/exec","last_synced_at":"2025-05-15T04:05:32.947Z","repository":{"id":38550081,"uuid":"113789853","full_name":"semantic-release/exec","owner":"semantic-release","description":":shell: semantic-release plugin to execute custom shell commands","archived":false,"fork":false,"pushed_at":"2025-05-09T21:02:00.000Z","size":2087,"stargazers_count":144,"open_issues_count":25,"forks_count":27,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-09T22:18:58.117Z","etag":null,"topics":["cli","publish","release","script","semantic-release","shell","version"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semantic-release.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-10T22:53:12.000Z","updated_at":"2025-05-09T21:01:24.000Z","dependencies_parsed_at":"2024-02-26T22:03:31.785Z","dependency_job_id":"4dc4553e-4d06-41c4-aa73-472cf16d267e","html_url":"https://github.com/semantic-release/exec","commit_stats":{"total_commits":333,"total_committers":12,"mean_commits":27.75,"dds":0.3213213213213213,"last_synced_commit":"3cf6ead79ca3fe754ec7b62b3517e7881f694c42"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semantic-release%2Fexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semantic-release","download_url":"https://codeload.github.com/semantic-release/exec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253555230,"owners_count":21926802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","publish","release","script","semantic-release","shell","version"],"created_at":"2024-08-02T05:00:42.232Z","updated_at":"2025-05-15T04:05:32.879Z","avatar_url":"https://github.com/semantic-release.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","cli"],"sub_categories":[],"readme":"# @semantic-release/exec\n\n[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to execute custom shell commands.\n\n[![Build Status](https://github.com/semantic-release/exec/workflows/Test/badge.svg)](https://github.com/semantic-release/exec/actions?query=workflow%3ATest+branch%3Amaster) [![npm latest version](https://img.shields.io/npm/v/@semantic-release/exec/latest.svg)](https://www.npmjs.com/package/@semantic-release/exec)\n[![npm next version](https://img.shields.io/npm/v/@semantic-release/exec/next.svg)](https://www.npmjs.com/package/@semantic-release/exec)\n[![npm beta version](https://img.shields.io/npm/v/@semantic-release/exec/beta.svg)](https://www.npmjs.com/package/@semantic-release/exec)\n\n| Step               | Description                                                                                             |\n| ------------------ | ------------------------------------------------------------------------------------------------------- |\n| `verifyConditions` | Execute a shell command to verify if the release should happen.                                         |\n| `analyzeCommits`   | Execute a shell command to determine the type of release.                                               |\n| `verifyRelease`    | Execute a shell command to verifying a release that was determined before and is about to be published. |\n| `generateNotes`    | Execute a shell command to generate the release note.                                                   |\n| `prepare`          | Execute a shell command to prepare the release.                                                         |\n| `publish`          | Execute a shell command to publish the release.                                                         |\n| `success`          | Execute a shell command to notify of a new release.                                                     |\n| `fail`             | Execute a shell command to notify of a failed release.                                                  |\n\n## Install\n\n```bash\n$ npm install @semantic-release/exec -D\n```\n\n## Usage\n\nThe plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):\n\n```json\n{\n  \"plugins\": [\n    \"@semantic-release/commit-analyzer\",\n    \"@semantic-release/release-notes-generator\",\n    [\n      \"@semantic-release/exec\",\n      {\n        \"verifyConditionsCmd\": \"./verify.sh\",\n        \"publishCmd\": \"./publish.sh ${nextRelease.version} ${branch.name} ${commits.length} ${Date.now()}\"\n      }\n    ]\n  ]\n}\n```\n\nWith this example:\n\n- the shell command `./verify.sh` will be executed on the [verify conditions step](https://github.com/semantic-release/semantic-release#release-steps)\n- the shell command `./publish.sh 1.0.0 master 3 870668040000` (for the release of version `1.0.0` from branch `master` with `3` commits on `August 4th, 1997 at 2:14 AM`) will be executed on the [publish step](https://github.com/semantic-release/semantic-release#release-steps)\n\n**Note**: it's required to define a plugin for the [analyze commits step](https://github.com/semantic-release/semantic-release#release-steps). If no [analyzeCommitsCmd](#analyzecommitscmd) is defined the plugin [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer) must be defined in the `plugins` list.\n\n## Configuration\n\n### Options\n\n| Options               | Description                                                                                                                                                                                                                                                                                                                              |\n| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `verifyConditionsCmd` | The shell command to execute during the verify condition step. See [verifyConditionsCmd](#verifyconditionscmd).                                                                                                                                                                                                                          |\n| `analyzeCommitsCmd`   | The shell command to execute during the analyze commits step. See [analyzeCommitsCmd](#analyzecommitscmd).                                                                                                                                                                                                                               |\n| `verifyReleaseCmd`    | The shell command to execute during the verify release step. See [verifyReleaseCmd](#verifyreleasecmd).                                                                                                                                                                                                                                  |\n| `generateNotesCmd`    | The shell command to execute during the generate notes step. See [generateNotesCmd](#generatenotescmd).                                                                                                                                                                                                                                  |\n| `prepareCmd`          | The shell command to execute during the prepare step. See [prepareCmd](#preparecmd).                                                                                                                                                                                                                                                     |\n| `addChannelCmd`       | The shell command to execute during the add channel step. See [addChannelCmd](#addchannelcmd).                                                                                                                                                                                                                                           |\n| `publishCmd`          | The shell command to execute during the publish step. See [publishCmd](#publishcmd).                                                                                                                                                                                                                                                     |\n| `successCmd`          | The shell command to execute during the success step. See [successCmd](#successcmd).                                                                                                                                                                                                                                                     |\n| `failCmd`             | The shell command to execute during the fail step. See [failCmd](#failcmd).                                                                                                                                                                                                                                                              |\n| `shell`               | The shell to use to run the command. See [execa#shell](https://github.com/sindresorhus/execa#shell).                                                                                                                                                                                                                                     |\n| `execCwd`             | The path to use as current working directory when executing the shell commands. This path is relative to the path from which **semantic-release** is running. For example if **semantic-release** runs from `/my-project` and `execCwd` is set to `buildScripts` then the shell command will be executed from `/my-project/buildScripts` |\n\nEach shell command is generated with [Lodash template](https://lodash.com/docs#template). All the [`context` object keys](https://github.com/semantic-release/semantic-release/blob/master/docs/developer-guide/plugin.md#context) passed to semantic-release plugins are available as template options.\n\n## verifyConditionsCmd\n\nExecute a shell command to verify if the release should happen.\n\n| Command property | Description                                                              |\n| ---------------- | ------------------------------------------------------------------------ |\n| `exit code`      | `0` if the verification is successful, or any other exit code otherwise. |\n| `stdout`         | Write only the reason for the verification to fail.                      |\n| `stderr`         | Can be used for logging.                                                 |\n\n## analyzeCommitsCmd\n\n| Command property | Description                                                                                                                                                |\n| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error.                                        |\n| `stdout`         | Only the release type (`major`, `minor` or `patch` etc..) can be written to `stdout`. If no release has to be done the command must not write to `stdout`. |\n| `stderr`         | Can be used for logging.                                                                                                                                   |\n\n## verifyReleaseCmd\n\n| Command property | Description                                                              |\n| ---------------- | ------------------------------------------------------------------------ |\n| `exit code`      | `0` if the verification is successful, or any other exit code otherwise. |\n| `stdout`         | Only the reason for the verification to fail can be written to `stdout`. |\n| `stderr`         | Can be used for logging.                                                 |\n\n## generateNotesCmd\n\n| Command property | Description                                                                                                         |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |\n| `stdout`         | Only the release note must be written to `stdout`.                                                                  |\n| `stderr`         | Can be used for logging.                                                                                            |\n\n## prepareCmd\n\n| Command property | Description                                                                                                         |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |\n| `stdout`         | Can be used for logging.                                                                                            |\n| `stderr`         | Can be used for logging.                                                                                            |\n\n## addChannelCmd\n\n| Command property | Description                                                                                                                                                                                                                                        |\n| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error.                                                                                                                                |\n| `stdout`         | The `release` information can be written to `stdout` as parseable JSON (for example `{\"name\": \"Release name\", \"url\": \"http://url/release/1.0.0\"}`). If the command write non parseable JSON to `stdout` no `release` information will be returned. |\n| `stderr`         | Can be used for logging.                                                                                                                                                                                                                           |\n\n## publishCmd\n\n| Command property | Description                                                                                                                                                                                                                                        |\n| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error.                                                                                                                                |\n| `stdout`         | The `release` information can be written to `stdout` as parseable JSON (for example `{\"name\": \"Release name\", \"url\": \"http://url/release/1.0.0\"}`). If the command write non parseable JSON to `stdout` no `release` information will be returned. |\n| `stderr`         | Can be used for logging.                                                                                                                                                                                                                           |\n\n## successCmd\n\n| Command property | Description                                                                                                         |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |\n| `stdout`         | Can be used for logging.                                                                                            |\n| `stderr`         | Can be used for logging.                                                                                            |\n\n## failCmd\n\n| Command property | Description                                                                                                         |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------- |\n| `exit code`      | Any non `0` code is considered as an unexpected error and will stop the `semantic-release` execution with an error. |\n| `stdout`         | Can be used for logging.                                                                                            |\n| `stderr`         | Can be used for logging.                                                                                            |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemantic-release%2Fexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemantic-release%2Fexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemantic-release%2Fexec/lists"}