diff --git a/README.md b/README.md index e7f5b99..35d902e 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,36 @@ This is a [`Docker` action](https://github.com/actions/toolkit/blob/e2adf403d6d1 - [conventional-changelog-lint-config-canonical](https://github.com/gajus/conventional-changelog-lint-config-canonical) - [commitlint-config-jira](https://github.com/Gherciu/commitlint-jira) -If you have a custom shared config that lies in a private registry, let us know! We will be happy to cover this case if necessary. +Apart from the shared configurations that are included by default, you can also include extra dependencies for other configs and plugins that you want to use. + +In order to do so, you can use `NODE_PATH` env var to make the action take those dependencies into account. Below is an example workflow that does that. + +```yaml +name: Commitlint +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + - run: npm install + - name: Add dependencies for commitlint action + # $GITHUB_WORKSPACE is the path to your repository + run: echo "::set-env name=NODE_PATH::$GITHUB_WORKSPACE/node_modules" + # Now the commitlint action will run considering its own dependencies and yours as well 🚀 + - uses: wagoid/commitlint-github-action@v1 +``` + +--- + +💡 You can see other ways to install your dependencies (including private ones) in [the Setup Node action's docs](https://github.com/actions/setup-node). + +---