diff --git a/README.md b/README.md index 0a9fb93..d89bd54 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ files with the `md` or `markdown` extension. - uses: articulate/actions-markdownlint@v1 ``` -You can set the config file, the files it scans, or files/directories to ignore. +You can set the config file, the files it scans, files/directories to ignore, or +the version of markdownlint-cli to install. ```yaml - uses: articulate/actions-markdownlint@v1 @@ -20,4 +21,5 @@ You can set the config file, the files it scans, or files/directories to ignore. config: markdownlint-config.json files: 'docs/**/*.md' ignore: node_modules + version: 0.28.1 ``` diff --git a/action.yml b/action.yml index 2c03fc4..aaf94b8 100644 --- a/action.yml +++ b/action.yml @@ -2,6 +2,9 @@ name: markdown-lint author: Articulate Global Inc. description: Lint your markdown inputs: + version: + description: Version of markdownlint-cli to use + required: false config: description: markdownlint config file required: false diff --git a/entrypoint.sh b/entrypoint.sh index 28d9690..a29e8c8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,10 @@ #!/bin/sh +if [ -n "$INPUT_VERSION" ]; then + echo "::debug::installing markdownlint-cli ${INPUT_VERSION}" + npm install --global --production "markdownlint-cli@${INPUT_VERSION}" +fi + # Copy the matcher to a shared volume with the host; otherwise "add-matcher" # can't find it. if [ "$INPUT_ANNOTATIONS" != "false" ]; then