Skip to content

Replace link checker workflow with markdown-link-check: streamline li… #1

Replace link checker workflow with markdown-link-check: streamline li…

Replace link checker workflow with markdown-link-check: streamline li… #1

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 markdown-link-check on README.md
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
configuration-file: .github/markdown-link-check-config.json
folder-path: ./README.md
- name: Check for broken links
run: |
readme1_output=$(cat ./README.md)
readme1_broken=$(echo "$readme1_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
# - name: Notify user of broken links
# if: failure()
# uses: dawidd6/action-send-mail@v4
# with:
# server_address: smtp.gmail.com
# server_port: 587
# username: ${{ secrets.GMAIL_USERNAME }}
# password: ${{ secrets.GMAIL_PASSWORD }}
# subject: ❌ Broken links detected in README.md
# body: '❌ Broken links were detected in README.md. Please check the workflow logs for details.'
# to: [email protected]
# from: [email protected]