From 7e530b06528466301b4a36b2aa1dcb23d6881488 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Fri, 7 Apr 2023 19:50:08 +0300 Subject: [PATCH] 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 294767e0567c0c47400a007bae35cf13f9508136. * 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 --- .github/workflows/cron-weekly.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/cron-weekly.yaml diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml new file mode 100644 index 0000000000..b1e3c496a7 --- /dev/null +++ b/.github/workflows/cron-weekly.yaml @@ -0,0 +1,30 @@ +name: Markdown Links Check +# runs every monday at 9 am +on: + schedule: + - cron: "0 9 * * 1" + workflow_dispatch: # allows to run manually for testing + +jobs: + check-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Check Markdown links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: markdown-link-check + # checks all markdown files from /docs including all subfolders + with: + use-quiet-mode: "yes" + use-verbose-mode: "yes" + config-file: ".github/workflows/markdown.links.config.json" + folder-path: "docs/" + + - name: Send Slack notification + run: | + 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 }} + echo "Sent Slack notification" + env: + LOGS_URL: ${{ https://github.com/coder/coder/actions/runs/${{ github.run_id }}