Skip to content

Commit

Permalink
Add link checking
Browse files Browse the repository at this point in the history
PR link checking currently disabled
  • Loading branch information
bernhold committed Oct 28, 2023
1 parent 09f5b5b commit 5007ae9
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/check-all-urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check All URLs

on:
workflow_dispatch:
schedule:
# Cron syntax has five fields separated by a space, and each field represents a unit of time.
#
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
# * is a special character in YAML so you have to quote this string
- cron: '0 0 7 * *' # midnight on the seventh day (arbitrary) of every month

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# We maintain the list of the URLs excluded from checking in a separate file so that we can use
# it in multiple workflows, while easily maintaining consistency.
- name: Read exclude-urls list
id: exclude
uses: juliangruber/read-file-action@v1
with:
path: ./.github/workflows/exclude-urls.txt

- name: urls-checker
uses: urlstechie/urlchecker-action@0.0.33
with:
# Use common exclude list read in above
exclude_urls: ${{ steps.exclude.outputs.content }}
timeout: 10
retry_count: 3
print_all: false
37 changes: 37 additions & 0 deletions .github/workflows/check-pr-urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check URLs in Changed Files

#on: [pull_request, push, workflow_dispatch]

jobs:
urlchecks:
name: check-urls
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- id: files
# uses: jitterbit/get-changed-files@v1 ### Hasn't been updated to Node16
uses: masesgroup/retrieve-changed-files@v2
with:
format: 'csv'

# We maintain the list of the URLs excluded from checking in a separate file so that we can use
# it in multiple workflows, while easily maintaining consistency.
- name: Read exclude-urls list
id: exclude
uses: juliangruber/read-file-action@v1
with:
path: ./.github/workflows/exclude-urls.txt

# Run URL checks
- name: URLs-checker
uses: urlstechie/urlchecker-action@0.0.33
with:
# only include the changed files
include_files: ${{ steps.files.outputs.added_modified }}
# Use common exclude list read in above
exclude_urls: ${{ steps.exclude.outputs.content }}
timeout: 10
retry_count: 3
print_all: false
1 change: 1 addition & 0 deletions .github/workflows/exclude-urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://en.w

0 comments on commit 5007ae9

Please sign in to comment.