Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add input to set version of markdownlint-cli #5

Merged
merged 2 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Articulate Global Inc.
Copyright (c) 2021 Articulate Global, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
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
```
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: markdown-lint
author: Articulate Global Inc.
author: Articulate Global, LLC
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