Skip to content

Update link checker workflow: enable continue-on-error and output stdout #10

Update link checker workflow: enable continue-on-error and output stdout

Update link checker workflow: enable continue-on-error and output stdout #10

Workflow file for this run

name: Link Checker
on:
workflow_dispatch:
push:
branches:
- main
jobs:
link-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Lychee link checker on README.md
id: lychee_readme1
uses: lycheeverse/lychee-action@v2
with:
args: ./README.md
continue-on-error: true
outputs:

Check failure on line 23 in .github/workflows/check-links.yml

View workflow run for this annotation

GitHub Actions / Link Checker

Invalid workflow file

The workflow is not valid. .github/workflows/check-links.yml (Line: 23, Col: 7): Unexpected value 'outputs'
stdout: ${{ steps.lychee_readme1.outputs.stdout }}
# - name: Run Lychee link checker on README2.md
# id: lychee_readme2
# uses: lycheeverse/lychee-action@v2
# with:
# args: ./README2.md
- name: Check for broken links
run: |
readme1_output="${{ steps.lychee_readme1.outputs.stdout }}"
# readme2_output="${{ steps.lychee_readme2.outputs.stdout }}"
readme1_broken=$(echo "$readme1_output" | grep -E '"fail":\s*[1-9]+')
# readme2_broken=$(echo "$readme2_output" | grep -E '"fail":\s*[1-9]+')
if [ -n "$readme1_broken" ]; then
echo "❌ Broken links found in README.md"
exit 1
else
echo "✅ No broken links found in README.md"
fi