Skip to content

Commit

Permalink
try new link check util
Browse files Browse the repository at this point in the history
  • Loading branch information
markcmiller86 committed May 14, 2024
1 parent 3373b55 commit 42e39a9
Showing 1 changed file with 23 additions and 30 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/check-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip --no-cache-dir --disable-pip-version-check install --upgrade pip
python -m pip --no-cache-dir --disable-pip-version-check install linkchecker
- name: Reformat environment variables
id: setup_vars
run: |
Expand All @@ -48,39 +59,21 @@ jobs:
echo "ignore_file_patterns=" >> $GITHUB_OUTPUT
else
echo "files=" >> $GITHUB_OUTPUT
echo "ignore_file_patterns= ${{ steps.setup_vars.outputs.ignore_file_patterns }}" >> $GITHUB_OUTPUT
echo "ignore_file_patterns=${{ steps.setup_vars.outputs.ignore_file_patterns }}" >> $GITHUB_OUTPUT
fi
#exclude_patterns: ${{ steps.setup_vars.outputs.ignore_url_patterns }}
- name: Check URLs in selected files
uses: urlstechie/urlchecker-action@update/0.0.35
with:

# Work only on markdown files
file_types: .md

# Choose whether to include file with no URLs in the prints.
print_all: false

# More verbose summary at the end of a run
verbose: true

# How many times to retry a failed request (defaults to 1)
retry_count: 3

# Google Forms is having enormous timeouts
timeout: 10

# Ignore certificate issues
no_check_certs: True

# Exclude these patterns from the checker
exclude_patterns: ${{ steps.setup_vars.outputs.ignore_url_patterns }}

# Exclude these dirs and files
exclude_files: "${{ steps.file_list.outputs.ignore_file_patterns }}"

# Operate only on the specific list of files selected above
include_files: "${{ steps.file_list.outputs.files }}"
run: |
which linkchecker
for f in ${{ steps.file_list.outputs.files }}; do
for ef in ${{ steps.file_list.outputs.ignore_file_patterns }}; do
if [ "$ef" == "$f" ]; then
continue 2 # ignore this file
fi
done
echo $f
done
#
# Description:
Expand Down

0 comments on commit 42e39a9

Please sign in to comment.