-
Notifications
You must be signed in to change notification settings - Fork 19
60 lines (56 loc) · 2.18 KB
/
validate_urls.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Validate URLs
on:
page_build:
schedule:
# Runs at 14:00 and 23:00 UTC every day.
# Read more here: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#schedule
- cron: '00 14,23 * * *'
workflow_dispatch:
inputs:
branch:
description: 'Branch to crawl for broken links in .md and .swift files'
default: 'main'
required: true
jobs:
validate_documentation_links_on_branch:
name: Validate links on branch
runs-on: ubuntu-latest
env:
DEFAULT_BRANCH: main
steps:
- name: Configure variables
run: echo "GIT_BRANCH=${{ github.event.inputs.branch || env.DEFAULT_BRANCH }}" >> $GITHUB_ENV
- uses: urlstechie/urlchecker-action@master
with:
git_path: https://github.com/wwt/SwiftCurrent
branch: ${{ env.GIT_BRANCH }}
file_types: .md,.swift
exclude_urls: https://github.com/wwt/SwiftCurrent/discussions/new
exclude_patterns: https://img.shields.io,https://codecov.io
- name: slack-send
if: failure()
uses: slackapi/[email protected]
with:
payload: "{\"text\":\":alert: <https://github.com/wwt/SwiftCurrent/actions|URL Checker Failed> :alert: \"}"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
validate_documentation_links_on_website:
name: Validate links on Github Pages
runs-on: ubuntu-latest
steps:
- uses: urlstechie/urlchecker-action@master
with:
git_path: https://github.com/wwt/SwiftCurrent
branch: gh-pages
file_types: .html,.css,.scss
exclude_urls: https://github.com/wwt/SwiftCurrent/discussions/new,https://github.com/realm/jazzy,https://realm.io,https://github.com/wwt/SwiftCurrent
exclude_patterns: https://img.shields.io,https://codecov.io
- name: slack-send
if: failure()
uses: slackapi/[email protected]
with:
payload: "{\"text\":\":alert: <https://github.com/wwt/SwiftCurrent/actions|URL Checker Failed> :alert: \"}"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK