mirror of
https://github.com/gaurav-nelson/github-action-markdown-link-check.git
synced 2024-09-11 11:25:47 +03:00
Check markdown files
This commit is contained in:
parent
1aa0c7e0f9
commit
d1622fc5ce
8
.github/main.workflow
vendored
Normal file
8
.github/main.workflow
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
workflow "New workflow" {
|
||||
on = "push"
|
||||
resolves = ["markdown-link-check"]
|
||||
}
|
||||
|
||||
action "markdown-link-check" {
|
||||
uses = "./"
|
||||
}
|
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM alpine:3.8
|
||||
RUN apk add --no-cache bash nodejs npm
|
||||
LABEL "com.github.actions.name"="markdown-link-check"
|
||||
LABEL "com.github.actions.description"="Check if all links are valid in markdown files."
|
||||
LABEL "com.github.actions.icon"="link"
|
||||
LABEL "com.github.actions.color"="green"
|
||||
LABEL "repository"="https://github.com/gaurav-nelson/github-action-markdown-link-check.git"
|
||||
LABEL "homepage"="https://github.com/gaurav-nelson/github-action-markdown-link-check"
|
||||
LABEL "maintainer"="Gaurav Nelson"
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
22
README.md
22
README.md
@ -1,2 +1,20 @@
|
||||
# github-action-markdown-link-check
|
||||
Check all links in markdown files if they are alive or dead.
|
||||
# GitHub Action - Markdown link check 🔗✔️
|
||||
This GitHub action checks all Markdown files in your repository for broken links. (Uses [tcort/markdown-link-check](https://github.com/tcort/markdown-link-check))
|
||||
|
||||
## Sample workflow
|
||||
```
|
||||
workflow "New workflow" {
|
||||
on = "push"
|
||||
resolves = ["markdown-link-check"]
|
||||
}
|
||||
|
||||
action "markdown-link-check" {
|
||||
uses = "./"
|
||||
}
|
||||
```
|
||||
|
||||
## Test links
|
||||
|
||||
www.google.com
|
||||
|
||||
[This is a broken link](www.exampleexample.cox)
|
||||
|
17
entrypoint.sh
Normal file
17
entrypoint.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
npm i -g markdown-link-check
|
||||
|
||||
echo "=========================> MARKDOWN LINK CHECK <========================="
|
||||
|
||||
find . -name \*.md -not -path "./node_modules/*" -exec markdown-link-check {} \; 2> error.txt
|
||||
|
||||
echo "========================================================================="
|
||||
|
||||
if [ -e error.txt ] ; then
|
||||
if grep -q "ERROR:" error.txt; then
|
||||
exit 113
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user