Skip to content

Commit f1a1ffb

Browse files
committed
Expose --dot option
1 parent c8f4149 commit f1a1ffb

3 files changed

Lines changed: 22 additions & 18 deletions

File tree

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ A GitHub Action that performs style checking and linting for Markdown/CommonMark
1010
Basic usage with all options enabled:
1111

1212
```yaml
13-
14-
- name: markdownlint-cli
15-
uses: nosborn/github-action-markdown-cli@v3.0.1
16-
with:
17-
files: .
18-
config_file: .markdownlint.yaml
19-
ignore_files: examples/ignore/*
20-
ignore_path: examples/.markdownlintignore
21-
rules: examples/rules/custom.js
22-
13+
- name: markdownlint-cli
14+
uses: nosborn/github-action-markdown-cli@v3.2.0
15+
with:
16+
files: .
17+
config_file: .markdownlint.yaml
18+
dot: true
19+
ignore_files: examples/ignore/*
20+
ignore_path: examples/.markdownlintignore
21+
rules: examples/rules/custom.js
2322
```
2423
2524
## Inputs
2625
27-
* `files` - what to process (files, directories, globs)
28-
* `config_file` (optional) - configuration file (JSON or YAML)
29-
* `ignore_files` (optional) - files to ignore/exclude (file, directory, glob)
30-
* `ignore_path` (optional) - path to file with ignore pattern(s)
31-
* `rules` (optional) - custom rule files (file, directory, glob, package)
26+
- `files` - what to process (files, directories, globs)
27+
- `config_file` (optional) - configuration file (JSON or YAML)
28+
- `dot` (optional) - include files/folders with a dot (for example `.github`)
29+
- `ignore_files` (optional) - files to ignore/exclude (file, directory, glob)
30+
- `ignore_path` (optional) - path to file with ignore pattern(s)
31+
- `rules` (optional) - custom rule files (file, directory, glob, package)
3232

3333
## License
3434

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ inputs:
77
config_file:
88
description: configuration file (JSON or YAML)
99
required: false
10+
dot:
11+
description: include files/folders with a dot (for example `.github`)
12+
required: false
1013
files:
1114
description: files, directories, or globs
1215
required: true

entrypoint.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
MARKDOWNLINT=markdownlint
44
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_CONFIG_FILE:+ -c ${INPUT_CONFIG_FILE}}"
5+
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_DOT:+ -d}"
56
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_IGNORE_FILES:+ -i ${INPUT_IGNORE_FILES}}"
67
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_IGNORE_PATH:+ -p ${INPUT_IGNORE_PATH}}"
78
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_RULES:+ -r ${INPUT_RULES}}"
89

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

1415
# shellcheck disable=SC2086
15-
${MARKDOWNLINT} ${INPUT_FILES}
16+
${MARKDOWNLINT} ${INPUT_FILES:?}
1617
readonly RC=$?
1718

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

20-
exit ${RC}
21+
exit "${RC}"

0 commit comments

Comments
 (0)