Skip to content

Broken Link Check

Broken Link Check #83

name: "Broken Link Check"
on:
schedule:
- cron: 0 0 * * 0 # run every Sunday at midnight
jobs:
check:
name: "Check for broken links"
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
- name: "Check for broken links"
uses: lycheeverse/lychee-action@v1
id: lychee
with:
jobSummary: true
args: --no-progress --accept '200..=299, 401, 403, 405' .
- name: "Send Slack alert"
if: env.lychee_exit_code != 0
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: "https://hooks.slack.com/triggers/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" # TODO: set as env var?
with:
payload: |
{
"Details": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
- name: "Fail workflow"
if: env.lychee_exit_code != 0
run: exit ${{ env.lychee_exit_code }}