Validate URLs #1241
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |