Skip to content

Commit

Permalink
Expose --dot option
Browse files Browse the repository at this point in the history
  • Loading branch information
nosborn committed Sep 22, 2022
1 parent c8f4149 commit f1a1ffb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
30 changes: 15 additions & 15 deletions README.md
Expand Up @@ -10,25 +10,25 @@ A GitHub Action that performs style checking and linting for Markdown/CommonMark
Basic usage with all options enabled:

```yaml

- name: markdownlint-cli
uses: nosborn/github-action-markdown-cli@v3.0.1
with:
files: .
config_file: .markdownlint.yaml
ignore_files: examples/ignore/*
ignore_path: examples/.markdownlintignore
rules: examples/rules/custom.js

- name: markdownlint-cli
uses: nosborn/github-action-markdown-cli@v3.2.0
with:
files: .
config_file: .markdownlint.yaml
dot: true
ignore_files: examples/ignore/*
ignore_path: examples/.markdownlintignore
rules: examples/rules/custom.js
```

## Inputs

* `files` - what to process (files, directories, globs)
* `config_file` (optional) - configuration file (JSON or YAML)
* `ignore_files` (optional) - files to ignore/exclude (file, directory, glob)
* `ignore_path` (optional) - path to file with ignore pattern(s)
* `rules` (optional) - custom rule files (file, directory, glob, package)
- `files` - what to process (files, directories, globs)
- `config_file` (optional) - configuration file (JSON or YAML)
- `dot` (optional) - include files/folders with a dot (for example `.github`)
- `ignore_files` (optional) - files to ignore/exclude (file, directory, glob)
- `ignore_path` (optional) - path to file with ignore pattern(s)
- `rules` (optional) - custom rule files (file, directory, glob, package)

## License

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Expand Up @@ -7,6 +7,9 @@ inputs:
config_file:
description: configuration file (JSON or YAML)
required: false
dot:
description: include files/folders with a dot (for example `.github`)
required: false
files:
description: files, directories, or globs
required: true
Expand Down
7 changes: 4 additions & 3 deletions entrypoint.sh
Expand Up @@ -2,19 +2,20 @@

MARKDOWNLINT=markdownlint
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_CONFIG_FILE:+ -c ${INPUT_CONFIG_FILE}}"
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_DOT:+ -d}"
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_IGNORE_FILES:+ -i ${INPUT_IGNORE_FILES}}"
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_IGNORE_PATH:+ -p ${INPUT_IGNORE_PATH}}"
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_RULES:+ -r ${INPUT_RULES}}"

PROBLEM_MATCHER="$(mktemp -p "${GITHUB_WORKSPACE}")"
PROBLEM_MATCHER="$(mktemp -p "${GITHUB_WORKSPACE:?}")"
trap 'rm -f "${PROBLEM_MATCHER}"' EXIT
cp /markdownlint-problem-matcher.json "${PROBLEM_MATCHER:?}" || exit
echo "::add-matcher::${PROBLEM_MATCHER:?}"

# shellcheck disable=SC2086
${MARKDOWNLINT} ${INPUT_FILES}
${MARKDOWNLINT} ${INPUT_FILES:?}
readonly RC=$?

echo '::remove-matcher owner=markdownlint::'

exit ${RC}
exit "${RC}"

0 comments on commit f1a1ffb

Please sign in to comment.