🐛 Analyze dead links

This commit is contained in:
Frederik Hjorslev Poulsen 2020-04-04 22:19:26 +02:00
parent 3cfa9b3be6
commit 422066f863
No known key found for this signature in database
GPG Key ID: 23DDBC920BDE66CF
2 changed files with 8 additions and 9 deletions

View File

@ -21,12 +21,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Analyze Links
shell: pwsh
run: |
./DeadLinksAnalyzer.ps1
$deadlinks = Test-MarkdownLinks -Path ".\readme.md"
continue-on-error: true
- name: Analyze Links
shell: pwsh
run: |
./DeadLinksAnalyzer.ps1

View File

@ -16,11 +16,12 @@
try {
$request = Invoke-WebRequest -Uri $url
} catch {
Write-Error "Found dead url $url in $fileName"
Write-Warning -Message "Found dead url $url in $fileName"
$unreachable += $url
}
}
}
# Output urls
return $unreachable
Write-Error -Message 'Dead links found'
}