mirror of
https://github.com/janikvonrotz/awesome-powershell.git
synced 2025-02-25 09:21:18 -05:00
🐛 Analyze dead links
This commit is contained in:
parent
3cfa9b3be6
commit
422066f863
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@ -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
|
@ -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'
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user