Skip to content
Snippets Groups Projects
Unverified Commit d093dd4e authored by Casey's avatar Casey :recycle:
Browse files

CI: add ci to lint our markdown


let's keep things consistent.

Signed-off-by: default avatarCaleb Connolly <caleb@postmarketos.org>
parent 58b11f62
No related branches found
No related tags found
1 merge request!3CI: add ci to lint our markdown
#!/bin/sh -e
# Description: lint all markdown files
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk add npm
npm install -g markdownlint-cli
ln -sf /usr/local/lib/node_modules/markdownlint-cli/markdownlint.js /usr/bin/markdownlint-cli
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
MDL_FAILED=0
find . -name '*.md' |
while read -r file; do
echo "mdl: $file"
markdownlint-cli "$file" || MDL_FAILED=1
done
if [ "$MDL_FAILED" = "1" ]; then
echo "markdown lint failed!"
exit 1
fi
image: alpine:latest
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
default:
before_script:
- apk upgrade -U
- adduser -D build
markdownlint:
script:
- ".ci/markdown.sh"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment