Skip to content

Commit 7e530b0

Browse files
authored
chore: check for invalid markdown links in docs weekly (#6795)
* chore(ci): add an automatic check to verify markdown links. As per #6793, there are multiple broken links in our docs. This action will check if all markdown links are valid. cc: @ammario @bpmct * Revert "chore(ci): add an automatic check to verify markdown links. " This reverts commit 294767e. * Create cron-weekly.yaml * add workflow dispatch for testing * fmt * Update cron-weekly.yaml * remove slack notification for now * Add slack notification * Update cron-weekly.yaml * Add logs URL * fmt
1 parent 3e250c6 commit 7e530b0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/cron-weekly.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Markdown Links Check
2+
# runs every monday at 9 am
3+
on:
4+
schedule:
5+
- cron: "0 9 * * 1"
6+
workflow_dispatch: # allows to run manually for testing
7+
8+
jobs:
9+
check-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
15+
- name: Check Markdown links
16+
uses: gaurav-nelson/github-action-markdown-link-check@v1
17+
id: markdown-link-check
18+
# checks all markdown files from /docs including all subfolders
19+
with:
20+
use-quiet-mode: "yes"
21+
use-verbose-mode: "yes"
22+
config-file: ".github/workflows/markdown.links.config.json"
23+
folder-path: "docs/"
24+
25+
- name: Send Slack notification
26+
run: |
27+
curl -X POST -H 'Content-type: application/json' -d '{"msg":"Broken links found in the documentation. Please check the logs at ${{ env.LOGS_URL }}"}' ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }}
28+
echo "Sent Slack notification"
29+
env:
30+
LOGS_URL: ${{ https://github.com/coder/coder/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)