Skip to content

Commit

Permalink
Lint markdown files for broken links.
Browse files Browse the repository at this point in the history
  • Loading branch information
anybodys committed Dec 7, 2023
1 parent 68b2db4 commit 558b3c0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI Documentation Checks

on:
push:
branches:
- main
pull_request:


jobs:
lint-markdown:
name: Lint markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: tcort/[email protected]
- name: Markdown
run: make infra-lint-markdown
8 changes: 8 additions & 0 deletions .github/workflows/markdownlint-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
}
]
}
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ __check_defined = \
infra-configure-network \
infra-format \
infra-lint \
infra-lint-markdown \
infra-lint-scripts \
infra-lint-terraform \
infra-lint-workflows \
Expand Down Expand Up @@ -136,7 +137,10 @@ infra-check-compliance-checkov: ## Run checkov compliance checks
infra-check-compliance-tfsec: ## Run tfsec compliance checks
tfsec infra

infra-lint: infra-lint-scripts infra-lint-terraform infra-lint-workflows ## Lint infra code
infra-lint: infra-lint-markdown infra-lint-scripts infra-lint-terraform infra-lint-workflows ## Lint infra code

infra-lint-markdown: ## Lint Markdown docs for broken links
BASEURL=`pwd`; markdown-link-check *.md **/*.md --config .github/workflows/markdownlint-config.json

infra-lint-scripts: ## Lint shell scripts
shellcheck bin/**
Expand Down
8 changes: 7 additions & 1 deletion docs/infra/set-up-infrastructure-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ brew install gh

### Install linters

[Shellcheck](https://github.com/koalaman/shellcheck) and [actionlint](https://github.com/rhysd/actionlint) are optional utilites for running infrastructure linters locally.
We have several optional utilities for running infrastructure linters locally. These are run as part of the CI pipeline, therefore, it is often simpler to test them locally first.

* [Shellcheck](https://github.com/koalaman/shellcheck)
* [actionlint](https://github.com/rhysd/actionlint)
* [markdown-link-check](https://github.com/tcort/markdown-link-check)

```bash

brew install shellcheck
brew install actionlint
npm install -g markdown-link-check
```

## AWS Authentication
Expand Down

0 comments on commit 558b3c0

Please sign in to comment.