From 8ac1950edb628a369853ccd5ab5dd8778de7b683 Mon Sep 17 00:00:00 2001 From: Sudhir Mitharwal <6812992+sudkumar@users.noreply.github.com> Date: Sat, 4 Jan 2020 20:10:51 +0530 Subject: [PATCH] docs(extra_plugins): must be in release config Plugins passed in `extra_plugins` must be specified in the semantic release plugins array as well. https://semantic-release.gitbook.io/semantic-release/usage/configuration#plugins --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f33b0aa..38ee5f6 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ GitHub Action for [Semantic Release](https://github.com/semantic-release/semanti * `new_release_major_version`: Major version of the new release * `new_release_minor_version`: Minor version of the new release * `new_release_patch_version`: Patch version of the new release + +### Examples + +#### A simple example -A simple example ```yaml steps: - name: Checkout @@ -40,7 +43,8 @@ steps: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} ``` -An advanced example +#### Using `branch` and `semantic_version` + ```yaml steps: - name: Checkout @@ -51,10 +55,6 @@ steps: with: branch: master semantic_version: 15.13.28 - # You can specify specifying version range for the extra plugins if you prefer. - extra_plugins: | - @semantic-release/git - @semantic-release/changelog@3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -64,5 +64,39 @@ steps: run: ... ``` +#### Passing Extra Plugins with `extra_plugins` + +The action can be used with `extra_plugins` option to specify plugins which are not in the [default list of plugins of semantic release](https://semantic-release.gitbook.io/semantic-release/usage/plugins#default-plugins). When using this option, please make sure that these plugins are also mentioned in your [semantic release config's plugins](https://semantic-release.gitbook.io/semantic-release/usage/configuration#plugins) array. For example, if you want to use `@semantic-release/git` and `@semantic-release/changelog` extra plugins, these must be added to `extra_plugins` in your actions file and `plugins` in your [release config file](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file) as shown bellow: + +_github-action_ +```yaml +steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + id: semantic # Need an `id` for output variables + with: + # You can specify specifying version range for the extra plugins if you prefer. + extra_plugins: | + @semantic-release/git + @semantic-release/changelog@3.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +_release-config_ + +```diff + plugins: [ + . + . ++ "@semantic-release/git", ++ "@semantic-release/changelog" + ] +``` + + ## [CHANGELOG](./docs/CHANGELOG.md)