diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..bcf9faabe5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Markdown Lint +on: pull_request +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Get file changes + id: get_file_changes + uses: trilom/file-changes-action@v1.2.3 + with: + output: ' ' + - name: Echo changed files + run: | + echo Changed files: ${{ steps.get_file_changes.outputs.files }} + - name: Get only md files + id: get_md_changes + run: | + echo -e "::set-output name=files::\c";echo "${{ steps.get_file_changes.outputs.files }}" | for i in $(cat) ; do if [[ $i == *.md ]]; then echo -e "$i \c"; fi ;done + - name: markdownlint-cli + if: ${{ steps.get_md_changes.outputs.files}} + uses: nosborn/github-action-markdown-cli@v1.1.1 + with: + files: ${{ steps.get_md_changes.outputs.files}} + config_file: ".markdownlint" diff --git a/.markdownlint b/.markdownlint new file mode 100644 index 0000000000..eb6cdd7f15 --- /dev/null +++ b/.markdownlint @@ -0,0 +1,5 @@ +{ + "default": false, + "MD041": true, + "MD013": { "line_length": 120 } +}