8000
name: weekly-docs | |
# runs every monday at 9 am | |
on: | |
schedule: | |
- cron: "0 9 * * 1" | |
workflow_dispatch: # allows to run manually for testing | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "docs/**" | |
permissions: | |
contents: read | |
jobs: | |
check-docs: | |
# later versions of Ubuntu have disabled unprivileged user namespaces, which are required by the action | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: write # required to post PR review comments by the action | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Check Markdown links | |
uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 # v1.2.5 | |
id: markdown-link-check | |
# checks all markdown files from /docs including all subfolders | |
with: | |
reporter: github-pr-review | |
config_file: ".github/.linkspector.yml" | |
fail_on_error: "true" | |
filter_mode: "nofilter" | |
- name: Send Slack notification | |
if: failure() && github.event_name == 'schedule' | |
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 }} |