Skip to content

Commit

Permalink
Update urlcheck.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hillarymarler committed Aug 28, 2024
1 parent 28cd483 commit ee91886
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/urlcheck.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#https://github.com/urlstechie/urlchecker-action/blob/master/examples/urlchecker-checkout.yml

on:
push:
Expand All @@ -15,25 +14,18 @@ jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: urls-checker
uses: urlstechie/urlchecker-action@master
with:
# A subfolder or path to navigate to in the present or cloned repository
subfolder: man, R

# A comma-separated list of file types to cover in the URL checks
file_types: .Rmd,.R, .Rd

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

# The timeout seconds to provide to requests, defaults to 5 seconds
timeout: 5

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

# choose if the force pass or not
force_pass : true
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: sudo apt-get install -y curl

- name: Find and check URLs
run: |
grep -Eo '(http|https)://[^/"]+' -r . | while read -r url; do
if ! curl --output /dev/null --silent --head --fail "$url"; then
echo "Broken URL: $url"
exit 1
fi
done

0 comments on commit ee91886

Please sign in to comment.