mirror of
https://github.com/coder/coder.git
synced 2026-06-04 21:48:22 +00:00
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
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@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Check Markdown links
|
|
uses: umbrelladocs/action-linkspector@874d01cae9fd488e3077b08952093235bd626977 # v1.3.7
|
|
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: "file"
|
|
|
|
- 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 '"${LOGS_URL}"'"}' "${{ secrets.DOCS_LINK_SLACK_WEBHOOK }}"
|
|
echo "Sent Slack notification"
|
|
env:
|
|
LOGS_URL: https://github.com/coder/coder/actions/runs/${{ github.run_id }}
|