From 422066f863e2b70e228403aa56f205b8b443c80c Mon Sep 17 00:00:00 2001 From: Frederik Hjorslev Poulsen Date: Sat, 4 Apr 2020 22:19:26 +0200 Subject: [PATCH] :bug: Analyze dead links --- .github/workflows/ci.yml | 14 ++++++-------- DeadLinksAnalyzer.ps1 | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6ad0d2..5217c59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file + - name: Analyze Links + shell: pwsh + run: | + ./DeadLinksAnalyzer.ps1 \ No newline at end of file diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 index 53c83fa..aa14654 100644 --- a/DeadLinksAnalyzer.ps1 +++ b/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' } \ No newline at end of file