-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (33 loc) · 1.07 KB
/
broken-link-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: "Broken Link Check"
on:
push:
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:
fail: true
jobSummary: true
args: --no-progress --accept '200..=299, 401, 405' .
continue-on-error: true
- 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 }}