Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Last active February 2, 2020 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruzickap/14a389171332517a4f1b717cc3fe2440 to your computer and use it in GitHub Desktop.
Save ruzickap/14a389171332517a4f1b717cc3fe2440 to your computer and use it in GitHub Desktop.
Automatically check links on web pages
git clone git@github.com:ruzickap/check_urls.git
cd check_urls
mkdir -p .github/workflows
cat > .github/workflows/periodic-broken-link-checks.yml << \EOF
name: periodic-broken-link-checks
on:
schedule:
- cron: '0 0 * * *'
pull_request:
types: [opened, synchronize]
paths:
- .github/workflows/periodic-broken-link-checks.yml
push:
branches:
- master
paths:
- .github/workflows/periodic-broken-link-checks.yml
jobs:
broken-link-checker:
runs-on: ubuntu-latest
steps:
- name: Broken link checker
env:
INPUT_URL: https://google.com
EXCLUDE: |
linkedin.com
localhost
myexample.dev
mylabs.dev
run: |
export INPUT_CMD_PARAMS="--one-page-only --verbose --buffer-size=8192 --concurrency=10 --exclude=($( echo ${EXCLUDE} | tr ' ' '|' ))"
wget -qO- https://raw.githubusercontent.com/ruzickap/action-my-broken-link-checker/v1/entrypoint.sh | bash
EOF
git add .
git commit -m "Add periodic-broken-link-checks"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment