Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
feat: add input to set version of markdownlint-cli
Browse files Browse the repository at this point in the history
fix #4
  • Loading branch information
mloberg committed Jul 23, 2021
1 parent 17b8abe commit 5eb2551
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ 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
with:
config: markdownlint-config.json
files: 'docs/**/*.md'
ignore: node_modules
version: 0.28.1
```
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5eb2551

Please sign in to comment.