From 3c0fa16bd01db16e22c9291679fb35da45e8478a Mon Sep 17 00:00:00 2001 From: Alexander Kiranov Date: Sat, 25 Nov 2023 12:46:41 +0200 Subject: [PATCH] added markdownlint github workflow --- .github/workflows/markdownlint.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/markdownlint.yml diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 0000000..403e1ad --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -0,0 +1,26 @@ +name: validate (lint) markdown files +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: check out repository code + uses: actions/checkout@v4 + + # NOTE: heavy node.js is used only to run markdownlint - the same tool as in my editor (Visual Studio Code) + + # source: https://github.com/nodesource/distributions#debian-and-ubuntu-based-distributions + - name: add node.js deb source + run: | + apt-get install -y ca-certificates curl gnupg && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && NODE_MAJOR=20 \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list + - name: install node.js + run: apt-get update && apt-get install nodejs -y + + - name: install markdownlint-cli + run: npm install -g markdownlint-cli + + - name: validate all markdown files + run: cd "${{ github.workspace }}" && markdownlint -p .gitignore .