Skip to content

Validate URLs

Validate URLs #1235

Workflow file for this run

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/slack-github-action@v1.16.0
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/slack-github-action@v1.16.0
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