diff --git a/.github/workflows/cron-weekly.yaml b/.github/workflows/cron-weekly.yaml new file mode 100644 index 0000000000000..b1e3c496a79c1 --- /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 }}