mirror of
https://github.com/cooklang/awesome-cooklang-recipes.git
synced 2025-10-29 11:22:09 +00:00
Merge pull request #5 from cooklang/add-markdown-link-check
Add markdown link check.
This commit is contained in:
commit
2450f39656
24
.github/workflows/link-check.yaml
vendored
Normal file
24
.github/workflows/link-check.yaml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
name: link-check
|
||||
on: # yamllint disable-line rule:truthy
|
||||
# Schedule check each day at 8 UTC
|
||||
schedule: [{cron: "0 8 * * *"}]
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
markdown-link-check:
|
||||
name: Markdown link check
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Check markdown links
|
||||
uses: gaurav-nelson/github-action-markdown-link-check@v1
|
||||
with:
|
||||
file-path: './README.md'
|
||||
config-file: './mlc_config.json'
|
||||
@ -1,6 +1,8 @@
|
||||
<!--lint disable awesome-git-repo-age-->
|
||||
# Awesome Cooklang Recipes [](https://awesome.re)
|
||||
|
||||
[](https://github.com/cooklang/awesome-cooklang-recipes/actions/workflows/link-check.yaml)
|
||||
|
||||
<img src="https://cooklang.org/images/logo.svg" align="left" width="144px" height="144px"/>
|
||||
|
||||
> [cooklang][1] is a recipe markup language used to simplify your personal recipe management, streamline your shopping
|
||||
|
||||
@ -20,6 +20,10 @@ tasks:
|
||||
cmds:
|
||||
- task: awesome-lint
|
||||
- task: yamllint
|
||||
linkcheck:
|
||||
desc: Check for dead links
|
||||
cmds:
|
||||
- ./scripts/linkcheck.sh
|
||||
render:
|
||||
desc: Render README.md
|
||||
cmds:
|
||||
|
||||
3
mlc_config.json
Normal file
3
mlc_config.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"aliveStatusCodes": [200, 206, 403, 429]
|
||||
}
|
||||
8
scripts/linkcheck.sh
Executable file
8
scripts/linkcheck.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )
|
||||
readonly DIR
|
||||
for f in $(find "${DIR}" -name \*.md); do
|
||||
docker run --rm -v /:/tmp:ro -i -w /tmp ghcr.io/tcort/markdown-link-check:stable "/tmp${f}" -c "/tmp${DIR}/mlc_config.json" || exit 1
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user