Skip to content

feat(metrics): add near-duplicate block detection #35

feat(metrics): add near-duplicate block detection

feat(metrics): add near-duplicate block detection #35

name: Validate Issue Links
on:
pull_request:
paths:
- "README.md"
- "AUTOMATION.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/workflows/validate-issue-links.yml"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Validate issue template links
run: |
set -euo pipefail
TEMPLATE_DIR=".github/ISSUE_TEMPLATE"
FILES_TO_CHECK="README.md AUTOMATION.md"
broken=0
for file in $FILES_TO_CHECK; do
if [ ! -f "$file" ]; then
continue
fi
# Extract all ?template=X.yml references
templates=$(grep -oP '(?<=\?template=)[^\s")\x27>\x60]+' "$file" || true)
for tmpl in $templates; do
if [ ! -f "$TEMPLATE_DIR/$tmpl" ]; then
echo "ERROR: $file references missing template: $TEMPLATE_DIR/$tmpl"
broken=1
fi
done
done
if [ "$broken" -eq 1 ]; then
echo ""
echo "Fix the broken template links listed above before merging."
exit 1
else
echo "All issue template links are valid."
fi