-
Notifications
You must be signed in to change notification settings - Fork 76
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
Gaurav Nelson
committed
Apr 3, 2019
1 parent
1aa0c7e
commit d1622fc
Showing
4 changed files
with
57 additions
and
2 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,8 @@ | ||
workflow "New workflow" { | ||
on = "push" | ||
resolves = ["markdown-link-check"] | ||
} | ||
|
||
action "markdown-link-check" { | ||
uses = "./" | ||
} |
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,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"] |
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 |
---|---|---|
@@ -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) |
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,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 |