-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 . |