Update .gitea/actions/test-links/action.yml
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
name: "Check Links"
|
||||
description: "Check all links in markdown files for validity"
|
||||
|
||||
inputs:
|
||||
user_repository:
|
||||
description: "Repository path in format owner/repo"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Check all links in markdown files
|
||||
shell: bash
|
||||
env:
|
||||
USER_REPO: ${{ inputs.user_repository }}
|
||||
run: |
|
||||
#!/bin/bash
|
||||
set -o pipefail
|
||||
@@ -19,6 +26,11 @@ runs:
|
||||
echo "Found $total_files markdown files to check"
|
||||
echo ""
|
||||
|
||||
# Get repository info from environment variable
|
||||
REPO_OWNER="${USER_REPO%/*}"
|
||||
REPO_NAME="${USER_REPO#*/}"
|
||||
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
||||
|
||||
has_errors=0
|
||||
file_index=1
|
||||
|
||||
@@ -65,13 +77,6 @@ runs:
|
||||
# Determine link category and validation status
|
||||
status="✓"
|
||||
|
||||
# Get repository info from git remote (once)
|
||||
if [ -z "$REPO_OWNER" ]; then
|
||||
REPO_OWNER=$(git config --get remote.origin.url | sed -n 's|.*[:/]\([^/]*\)/[^/]*\.git|\1|p' || echo "")
|
||||
REPO_NAME=$(git config --get remote.origin.url | sed -n 's|.*[:/][^/]*/\([^/]*\)\.git|\1|p' || echo "")
|
||||
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
||||
fi
|
||||
|
||||
# Check if it's an external URL
|
||||
if [[ "$decoded_link" =~ ^https?:// ]]; then
|
||||
# Replace git.sulej.net with internal gitea URL for checking
|
||||
|
||||
Reference in New Issue
Block a user